Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/__call-ci-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ permissions: {}

on:
workflow_call:
inputs:
create_release:
description: 'Whether to create a draft GitHub release after a successful build.'
required: false
default: true
type: boolean
secrets:
CODECOV_TOKEN:
description: 'Codecov token to use for the workflow.'
Expand Down Expand Up @@ -117,7 +123,9 @@ jobs:
verbose: true

release:
if: needs.setup_release.outputs.publish_release == 'true'
if: >-
needs.setup_release.outputs.publish_release == 'true' &&
inputs.create_release
needs:
- setup_release
- build
Expand Down
23 changes: 21 additions & 2 deletions .github/workflows/__global-replicator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,27 @@ jobs:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Replicating files (node)
- name: Replicating files (node CI)
uses: derberg/manage-files-in-multiple-repositories@beecbe897cf5ed7f3de5a791a3f2d70102fe7c25 # v2.1.0
with:
bot_branch_name: ${{ env.BOT_BRANCH_NAME }}
commit_message: ${{ env.COMMIT_MESSAGE }}
exclude_private: ${{ env.EXCLUDE_PRIVATE }}
repos_to_ignore: ${{ env.REPOS_TO_IGNORE }}
github_token: ${{ secrets.GH_BOT_TOKEN }}
committer_username: ${{ vars.GH_BOT_NAME }}
committer_email: ${{ secrets.GH_BOT_EMAIL }}
patterns_to_ignore: ''
patterns_to_include: >-
.github/workflows/_ci-node.yml
topics_to_include: 'nodejs'
exclude_forked: false
destination: ''

- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Replicating files (npm)
uses: derberg/manage-files-in-multiple-repositories@beecbe897cf5ed7f3de5a791a3f2d70102fe7c25 # v2.1.0
with:
bot_branch_name: ${{ env.BOT_BRANCH_NAME }}
Expand All @@ -240,7 +260,6 @@ jobs:
committer_email: ${{ secrets.GH_BOT_EMAIL }}
patterns_to_ignore: ''
patterns_to_include: >-
.github/workflows/_ci-node.yml,
.github/workflows/_update-npm.yml
topics_to_include: 'npm-pkg'
exclude_forked: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_ci-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
# the above-mentioned repo.

# To use, add the `npm-pkg` repository label to identify repositories that should trigger this workflow.
# To use, add the `nodejs` repository topic to identify repositories that should trigger this workflow.

# This will run standard CI for Node.js/npm/TypeScript projects.

Expand Down
8 changes: 8 additions & 0 deletions renovate-config.json5
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@
"matchUpdateTypes": ["patch", "minor"],
"schedule": ["* 1-7 * * 1"],
},
// Keep npm and GitHub dependency forms of highlight.js on the same version.
{
"groupName": "highlight.js",
"matchPackageNames": [
"@highlightjs/cdn-assets",
"highlightjs/highlight.js",
],
},
// Group Renovate updates in the .github repository and schedule them weekly
{
"groupName": "Renovate",
Expand Down
31 changes: 31 additions & 0 deletions tests/renovate-config.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import JSON5 from 'json5';
import {api as condaVersioning} from 'renovate/dist/modules/versioning/conda/index.js';
import {extractPackageFile as extractCdnUrlPackageFile} from 'renovate/dist/modules/manager/cdnurl/index.js';
import {extractPackageFile as extractRegexPackageFile} from 'renovate/dist/modules/manager/custom/regex/index.js';
import {extractPackageJson} from 'renovate/dist/modules/manager/npm/extract/common/package-file.js';
import {compile} from 'renovate/dist/util/template/index.js';
import {applyPackageRules} from 'renovate/dist/util/package-rules/index.js';

const renovateConfig = JSON5.parse(fs.readFileSync('renovate-config.json5', 'utf8'));
const githubRefManager = renovateConfig.customManagers.find(
Expand Down Expand Up @@ -72,6 +74,35 @@ function extractCondaDependencies(fileName, content) {
return extractRegexPackageFile(content, fileName, condaEnvironmentManager)?.deps ?? [];
}

test('groups highlight.js npm and GitHub dependencies', async () => {
const githubDependency = extractPackageJson({
devDependencies: {
'highlightjs-fixtures': 'github:highlightjs/highlight.js#1.2.3',
},
}, 'package.json').deps[0];
assert.deepEqual(
{
currentValue: githubDependency.currentValue,
datasource: githubDependency.datasource,
packageName: githubDependency.packageName,
},
{
currentValue: '1.2.3',
datasource: 'github-tags',
packageName: 'highlightjs/highlight.js',
},
);

for (const packageName of ['@highlightjs/cdn-assets', githubDependency.packageName]) {
const resolved = await applyPackageRules({
depName: packageName,
packageName,
packageRules: renovateConfig.packageRules,
});
assert.equal(resolved.groupName, 'highlight.js', packageName);
}
});

test('extracts the actionlint release and jsDelivr commit', () => {
const fileName = '.github/workflows/__call-common-lint.yml';
const content = fs.readFileSync(fileName, 'utf8');
Expand Down
Loading