From fda916d26ed8e93c66c613eb9af007fa0eba6fee Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 19 Sep 2026 19:13:38 -0400 Subject: [PATCH] fix: global config for dockle --- .github/workflows/__call-ci-node.yml | 10 +++++++- .github/workflows/__global-replicator.yml | 23 +++++++++++++++-- .github/workflows/_ci-node.yml | 2 +- renovate-config.json5 | 8 ++++++ tests/renovate-config.test.mjs | 31 +++++++++++++++++++++++ 5 files changed, 70 insertions(+), 4 deletions(-) diff --git a/.github/workflows/__call-ci-node.yml b/.github/workflows/__call-ci-node.yml index 1c9a9e8f..32e45468 100644 --- a/.github/workflows/__call-ci-node.yml +++ b/.github/workflows/__call-ci-node.yml @@ -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.' @@ -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 diff --git a/.github/workflows/__global-replicator.yml b/.github/workflows/__global-replicator.yml index 233dcb46..793c7af5 100644 --- a/.github/workflows/__global-replicator.yml +++ b/.github/workflows/__global-replicator.yml @@ -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 }} @@ -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 diff --git a/.github/workflows/_ci-node.yml b/.github/workflows/_ci-node.yml index d1cc10b7..7faae955 100644 --- a/.github/workflows/_ci-node.yml +++ b/.github/workflows/_ci-node.yml @@ -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. diff --git a/renovate-config.json5 b/renovate-config.json5 index 61115e84..7d0002a8 100644 --- a/renovate-config.json5 +++ b/renovate-config.json5 @@ -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", diff --git a/tests/renovate-config.test.mjs b/tests/renovate-config.test.mjs index ae086ecd..1a2fa786 100644 --- a/tests/renovate-config.test.mjs +++ b/tests/renovate-config.test.mjs @@ -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( @@ -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');