From f7ab4089fd35c80fbbc8750da5a5a41dbc0611f1 Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sun, 15 Nov 2026 14:14:48 -0500 Subject: [PATCH 1/4] ci(release): read the ci-workflows pin from the workflow uses lines release/dependencies.json no longer records a ci-workflows repository pin. The composite-action uses: lines are its only record, as for every other Action: ReleasePinSources.ps1 requires them to name one commit and one `# vX.Y.Z` release, skipping @main reusable callers and the sync-managed pin, and the freshness gate checks the tag and its commit like other Actions. Co-Authored-By: Claude Opus 5.5 --- .github/scripts/release-pins.test.cjs | 22 ++++++++++++ .../scripts/workflow-pin-metadata.test.cjs | 34 +++--------------- docs/releases.md | 35 +++++++++++-------- release/dependencies.json | 8 +---- scripts/ReleasePinSources.ps1 | 13 +++++-- scripts/Test-DependencyFreshness.ps1 | 2 +- 6 files changed, 60 insertions(+), 54 deletions(-) diff --git a/.github/scripts/release-pins.test.cjs b/.github/scripts/release-pins.test.cjs index aa604db..23b4123 100644 --- a/.github/scripts/release-pins.test.cjs +++ b/.github/scripts/release-pins.test.cjs @@ -16,6 +16,10 @@ const checkout = readdirSync(workflowDirectory) .map((name) => /actions\/checkout@[0-9a-f]{40} # v[0-9]+\.[0-9]+\.[0-9]+/u.exec(readFileSync(join(workflowDirectory, name), "utf8"))?.[0]) .find((reference) => reference !== undefined); const bumpedCheckout = `actions/checkout@${"a".repeat(40)} # v999.0.0`; +const ciWorkflowsPin = /uses: melodic-software\/ci-workflows\/\.github\/actions\/\S+@([0-9a-f]{40} # v[0-9]+\.[0-9]+\.[0-9]+)/u.exec( + readFileSync(join(workflowDirectory, "pr-require-checks.yml"), "utf8"), +)?.[1]; +const bumpedCiWorkflowsPin = `${"c".repeat(40)} # v999.0.0`; const runnerFrom = /^FROM ghcr\.io\/actions\/actions-runner:\S+$/mu.exec(readFileSync(join(repositoryRoot, "Dockerfile"), "utf8"))?.[0]; // Runs Test-ReleasePins.ps1 against a copy of the repository after `edit` @@ -66,6 +70,24 @@ test("a grouped Action bump passes without a manifest edit", () => { assert.equal(result.status, 0, result.stderr + result.stdout); }); +test("a grouped ci-workflows bump passes without a manifest edit", () => { + const result = checkPins((root) => { + rewrite(join(root, ".github", "workflows", "pr-require-checks.yml"), `@${ciWorkflowsPin}`, `@${bumpedCiWorkflowsPin}`); + }); + assert.equal(result.status, 0, result.stderr + result.stdout); +}); + +test("ci-workflows actions that name different releases fail with their locations", () => { + const result = checkPins((root) => { + const path = join(root, ".github", "workflows", "pr-require-checks.yml"); + const source = readFileSync(path, "utf8"); + assert.ok(source.includes(`@${ciWorkflowsPin}`), `${path} does not contain ${ciWorkflowsPin}`); + writeFileSync(path, source.replace(`@${ciWorkflowsPin}`, `@${bumpedCiWorkflowsPin}`)); + }); + assert.notEqual(result.status, 0); + assert.match(result.stderr + result.stdout, /\.yml:\d+ pins melodic-software\/ci-workflows@[0-9a-f]{40} # v[0-9.]+, but \S+\.yml:\d+ pins/u); +}); + test("a runner image bump passes without a manifest edit", () => { const result = checkPins((root) => { rewrite(join(root, "Dockerfile"), runnerFrom, `FROM ghcr.io/actions/actions-runner:999.0.0@sha256:${"b".repeat(64)}`); diff --git a/.github/scripts/workflow-pin-metadata.test.cjs b/.github/scripts/workflow-pin-metadata.test.cjs index 9e7adea..57ccf05 100644 --- a/.github/scripts/workflow-pin-metadata.test.cjs +++ b/.github/scripts/workflow-pin-metadata.test.cjs @@ -106,16 +106,11 @@ function workflowFiles(directory) { .sort(); } -// The reviewed ci-workflows pin is whatever the canonical references agree on, -// not a constant repeated here. A grouped Dependabot bump rewrites every -// canonical `uses:` line at once and cannot touch this file or -// `release/dependencies.json`, so hardcoding the SHA, the version and the -// reference count made every bump red by construction and cost three manual -// edits. The tests below assert the properties that matter instead: the -// expected callers are all present, the references agree with each other, and -// the release manifest agrees with them. None of the three moves when only a -// SHA moves, which leaves `release/dependencies.json` as the single manual -// edit per bump. +// The ci-workflows pin is whatever the canonical references agree on: the +// `uses:` lines are its only record. A grouped Dependabot bump rewrites every +// canonical line at once and cannot edit this file, so the test asserts what a +// SHA move leaves alone: the expected callers are all present and the +// references name one commit and one release. function ciWorkflowsPin() { const references = []; const versions = []; @@ -222,25 +217,6 @@ test("pr-run-checks-go uses the exact reusable caller contract", () => { ); }); -test("release metadata tracks the same ci-workflows release", () => { - const { sha } = ciWorkflowsPin(); - const dependencies = JSON.parse( - fs.readFileSync(path.join(repositoryRoot, "release", "dependencies.json"), "utf8"), - ); - assert.deepEqual( - dependencies.repositoryPins.filter( - ({ repository }) => repository === "melodic-software/ci-workflows", - ), - [ - { - repository: "melodic-software/ci-workflows", - commit: sha, - source: `https://github.com/melodic-software/ci-workflows/tree/${sha}`, - }, - ], - ); -}); - test("local Go jobs do not duplicate reusable quality checks", () => { const source = workflowSource("pr-require-checks.yml"); assert.doesNotMatch(source, /^ {2}go:\s*$/mu); diff --git a/docs/releases.md b/docs/releases.md index 8bbebc1..b337cac 100644 --- a/docs/releases.md +++ b/docs/releases.md @@ -85,15 +85,18 @@ Actions. The workflow `uses:` lines and the Dockerfile `FROM` line are the only record of those pins, so a Dependabot bump needs no other edit: `scripts/ReleasePinSources.ps1` reads them, and `Test-ReleasePins.ps1` requires every external Action to carry a `# vX.Y.Z` comment and name one release per -repository. `release/dependencies.json` keeps only what those lines cannot -carry: archive checksums, image digests of release tooling, sources, and the -`melodic-software/ci-workflows` repository pin. The release workflow's freshness -gate validates each Action's current tag and tag-to-commit mapping, the runner -tag's GHCR digest, and the runner archive digest against the SHA-256 the runner -release notes publish. Minor and patch bumps of `actions/*`, `github/*` and -`anthropics/*` Actions take the `vendor-actions` auto-merge lane -(`pr-automerge-dependabot.yml`), which merges once `CI Status` passes; every -other update PR is review-only. +repository. The `melodic-software/ci-workflows` composite actions follow the +same rule: every one outside a sync-managed file pins one commit with one +`# vX.Y.Z` release comment. `release/dependencies.json` keeps only what those +lines cannot carry: archive checksums, image digests of release tooling, and +sources. The release workflow's freshness gate validates each Action's current +tag and tag-to-commit mapping, ci-workflows included, the runner tag's GHCR +digest, and the runner archive digest against the SHA-256 the runner release +notes publish. Two Dependabot groups take the auto-merge lane +(`pr-automerge-dependabot.yml`), which merges once `CI Status` passes: +`first-party-actions` moves every ci-workflows composite-action pin in one pull +request (a non-major bump; a ci-workflows major is left for a person), and `vendor-actions` carries minor and patch bumps of `actions/*`, +`github/*` and `anthropics/*` Actions. Every other update PR is review-only. On a first run, the workflow pushes the BuildKit result without a tag, pulls and contract-tests that exact registry digest, publishes and verifies the immutable @@ -173,14 +176,16 @@ installer or `latest`: when the digest behind the pinned runner tag changes; - retain at least the latest three known-good compatibility pairs; - never auto-merge controller, runner, image, toolchain, Scale Set Client, - Action, or release changes, except the `vendor-actions` lane's minor and - patch Action bumps. + Action, or release changes, except the `first-party-actions` lane's + non-major ci-workflows bumps and the `vendor-actions` lane's minor and patch Action + bumps. A partial drain may advance mechanical toolchain and publication pins while -holding a cross-repository SHA pin such as `melodic-software/ci-workflows`. -Record the reviewed hold in `release/dependency-drift-review.json`; the release -freshness gate continues to report the held row until a dedicated -compatibility PR moves every reference together. +holding an Action pin such as `melodic-software/ci-workflows`. Record the +reviewed hold in `release/dependency-drift-review.json` under the gate's row +name (`github-action:melodic-software/ci-workflows`); the release freshness gate +continues to report the held row until one pull request moves every reference +together. Between releases, `.github/workflows/maintenance-check-dependency-freshness.yml` runs the same check daily at 06:41 UTC, or on a manual dispatch, so drift is diff --git a/release/dependencies.json b/release/dependencies.json index ee16747..e5412cd 100644 --- a/release/dependencies.json +++ b/release/dependencies.json @@ -65,12 +65,6 @@ "digest": "sha256:3c70e6d5979364cefdc22b51617a78fd264574d3bd6b4f84a351204147025e2a", "source": "https://github.com/anchore/syft/releases/tag/v1.57.0" }, - "repositoryPins": [ - { - "repository": "melodic-software/ci-workflows", - "commit": "9bfbca898bff801f5a8fd3d0f98ae6a0538e4386", - "source": "https://github.com/melodic-software/ci-workflows/tree/9bfbca898bff801f5a8fd3d0f98ae6a0538e4386" - } - ], + "repositoryPins": [], "reusableWorkflows": [] } diff --git a/scripts/ReleasePinSources.ps1 b/scripts/ReleasePinSources.ps1 index b771d96..1cc80f4 100644 --- a/scripts/ReleasePinSources.ps1 +++ b/scripts/ReleasePinSources.ps1 @@ -19,12 +19,17 @@ function Get-RunnerBasePin([string] $Dockerfile) { } # One pin per external Action repository, from every `uses: owner/repo[/path]@ # vX.Y.Z` -# line outside the excluded repositories. Every use of a repository must agree. +# line outside the excluded repositories. Every use of a repository must agree, so the +# melodic-software/ci-workflows composite actions name one release. Two ci-workflows +# references are not Action pins: a reusable workflow called at @main (standards#911), +# and the pin in a SYNC-MANAGED file, which the standards sync owns. function Get-WorkflowActionPins([string] $WorkflowDirectory, [string[]] $ExcludedRepositories = @()) { $pins = [ordered]@{} foreach ($file in Get-ChildItem -LiteralPath $WorkflowDirectory -Filter '*.yml' -File | Sort-Object Name) { + $lines = @(Get-Content -LiteralPath $file.FullName) + $syncManaged = @($lines | Where-Object { $_.Contains('SYNC-MANAGED FILE') }).Count -gt 0 $lineNumber = 0 - foreach ($line in Get-Content -LiteralPath $file.FullName) { + foreach ($line in $lines) { $lineNumber++ if ($line -notmatch '^\s*(?:-\s+)?uses:\s*(?[^\s#]+)(?.*)$') { continue @@ -38,6 +43,10 @@ function Get-WorkflowActionPins([string] $WorkflowDirectory, [string[]] $Exclude if ($ExcludedRepositories -contains $repository) { continue } + if ($repository -eq 'melodic-software/ci-workflows' -and + ($syncManaged -or $reference -cmatch '^melodic-software/ci-workflows/\.github/workflows/[A-Za-z0-9_.-]+\.ya?ml@main$')) { + continue + } $location = "$($file.Name):$lineNumber" if ($reference -notmatch '@(?[0-9a-f]{40})$' ) { throw "$location pins $reference, not a full commit SHA" diff --git a/scripts/Test-DependencyFreshness.ps1 b/scripts/Test-DependencyFreshness.ps1 index 7073f5a..e75fdbe 100644 --- a/scripts/Test-DependencyFreshness.ps1 +++ b/scripts/Test-DependencyFreshness.ps1 @@ -23,7 +23,7 @@ $dependencies = Get-Content -Raw -LiteralPath $DependencyManifest | ConvertFrom- . (Join-Path $PSScriptRoot 'ReleasePinSources.ps1') $repositoryRoot = Split-Path -Parent $PSScriptRoot $runnerBase = Get-RunnerBasePin (Join-Path $repositoryRoot 'Dockerfile') -$pinnedElsewhere = @($dependencies.repositoryPins.repository) + +$pinnedElsewhere = @($dependencies.repositoryPins | ForEach-Object repository) + @($dependencies.reusableWorkflows | ForEach-Object { ($_.reference -split '/')[0..1] -join '/' }) $githubActions = Get-WorkflowActionPins (Join-Path $repositoryRoot '.github\workflows') $pinnedElsewhere $now = [DateTimeOffset]::UtcNow From cf9640da760d73db484312d947b58582364aa5c5 Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sun, 15 Nov 2026 14:15:30 -0500 Subject: [PATCH 2/4] ci(dependabot): let Dependabot bump the ci-workflows action pins The sixteen ci-workflows composite-action pins in pr-require-checks.yml move to the v0.74.0 release commit with a `# v0.74.0` comment. Dependabot then keeps them current: the blanket ignore of melodic-software/ci-workflows becomes an ignore of the one pin in the sync-managed file, first-party releases skip the cooldown, and they move together in a `first-party-actions` group that the auto-merge caller arms from the synced Dependabot policy. Co-Authored-By: Claude Opus 5.5 --- .github/dependabot.yml | 22 ++++++++++++----- .github/workflows/pr-require-checks.yml | 32 ++++++++++++------------- 2 files changed, 32 insertions(+), 22 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2ad4dff..d336c46 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -49,17 +49,27 @@ updates: timezone: America/New_York cooldown: default-days: 7 + # First-party releases take no soak (the synced Dependabot policy's + # `fastTrack.own`). + exclude: + - "melodic-software/ci-workflows/*" open-pull-requests-limit: 5 commit-message: prefix: build - # ci-workflows pins move only in the org-wide repin wave, so every repo stays on one - # ci-workflows release; a Dependabot bump would move this repo's pins alone. + # The one first-party pin Dependabot leaves alone sits in the sync-managed + # pr-check-managed-files-hosted.yml, which the standards sync owns. ignore: - - dependency-name: "melodic-software/ci-workflows/*" - # The `vendor-actions` group (non-major only) is the auto-merge lane armed - # by pr-automerge-dependabot.yml; a dependency joins the first group that - # matches it, so majors fall through to the reviewed `github-actions` group. + - dependency-name: "melodic-software/ci-workflows/.github/actions/check-managed-files" + # The `first-party-actions` group and the `vendor-actions` group (non-major + # only) are the auto-merge lanes armed by pr-automerge-dependabot.yml; a + # dependency joins the first group that matches it, so majors fall through + # to the reviewed `github-actions` group. groups: + # Every ci-workflows composite-action pin moves in one pull request, so + # the repository stays on one ci-workflows release. + first-party-actions: + patterns: + - "melodic-software/*" vendor-actions: patterns: - actions/* diff --git a/.github/workflows/pr-require-checks.yml b/.github/workflows/pr-require-checks.yml index 2327b94..8c39f48 100644 --- a/.github/workflows/pr-require-checks.yml +++ b/.github/workflows/pr-require-checks.yml @@ -88,7 +88,7 @@ jobs: with: persist-credentials: false - name: Lint Markdown - uses: melodic-software/ci-workflows/.github/actions/markdownlint@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/markdownlint@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 with: config: .markdownlint-cli2.jsonc @@ -103,7 +103,7 @@ jobs: with: persist-credentials: false - name: Lint shell - uses: melodic-software/ci-workflows/.github/actions/shellcheck@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/shellcheck@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 with: rcfile: .shellcheckrc @@ -118,7 +118,7 @@ jobs: with: persist-credentials: false - name: Check shell formatting - uses: melodic-software/ci-workflows/.github/actions/shfmt@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/shfmt@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 typos: name: Spelling @@ -131,7 +131,7 @@ jobs: with: persist-credentials: false - name: Check spelling - uses: melodic-software/ci-workflows/.github/actions/typos@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/typos@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 with: config: _typos.toml @@ -146,7 +146,7 @@ jobs: with: persist-credentials: false - name: Check EditorConfig conformance - uses: melodic-software/ci-workflows/.github/actions/editorconfig-checker@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/editorconfig-checker@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 with: config: .editorconfig-checker.json @@ -162,7 +162,7 @@ jobs: fetch-depth: 0 persist-credentials: false - name: Scan for secrets - uses: melodic-software/ci-workflows/.github/actions/gitleaks@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/gitleaks@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 with: config: .gitleaks.toml @@ -177,7 +177,7 @@ jobs: with: persist-credentials: false - name: Check local links and anchors - uses: melodic-software/ci-workflows/.github/actions/lychee-offline@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/lychee-offline@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 with: config: lychee.toml @@ -192,7 +192,7 @@ jobs: with: persist-credentials: false - name: Scan comment hygiene - uses: melodic-software/ci-workflows/.github/actions/check-comment-markers@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/check-comment-markers@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 actionlint: name: Actionlint @@ -205,7 +205,7 @@ jobs: with: persist-credentials: false - name: Lint workflows - uses: melodic-software/ci-workflows/.github/actions/actionlint@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/actionlint@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 jsonschema: name: Jsonschema @@ -218,12 +218,12 @@ jobs: with: persist-credentials: false - name: Validate Dependabot configuration - uses: melodic-software/ci-workflows/.github/actions/check-jsonschema@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/check-jsonschema@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 with: builtin-schema: vendor.dependabot files: .github/dependabot.yml - name: Validate workflows - uses: melodic-software/ci-workflows/.github/actions/check-jsonschema@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/check-jsonschema@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 with: builtin-schema: vendor.github-workflows files: .github/workflows/*.yml @@ -239,7 +239,7 @@ jobs: with: persist-credentials: false - name: Check executable bits - uses: melodic-software/ci-workflows/.github/actions/check-exec-bit@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/check-exec-bit@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 check-machine-paths: name: Check Machine Paths @@ -252,7 +252,7 @@ jobs: with: persist-credentials: false - name: Check machine-specific paths - uses: melodic-software/ci-workflows/.github/actions/check-machine-paths@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/check-machine-paths@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 with: # These files assert the official image's fixed in-container runner # home. They contain no host/user path; keep the exception exact. @@ -275,7 +275,7 @@ jobs: with: persist-credentials: false - name: Check index-level EOL drift - uses: melodic-software/ci-workflows/.github/actions/check-line-endings@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/check-line-endings@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 pr-audit-workflows: name: Zizmor @@ -503,7 +503,7 @@ jobs: statuses: write # Records and reads back the `ci-lanes` commit status. steps: - name: Check the pull-request contract - uses: melodic-software/ci-workflows/.github/actions/pr-require-checks/check-contract@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/pr-require-checks/check-contract@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 with: token: ${{ github.token }} # Dependabot and the standards sync open pull requests that close no @@ -519,7 +519,7 @@ jobs: # aggregation: the job still fails on the contract step's exit code, and # the `ci-lanes` status is on the SHA for the next contract-only run. if: ${{ !cancelled() }} - uses: melodic-software/ci-workflows/.github/actions/pr-require-checks/aggregate-results@9bfbca898bff801f5a8fd3d0f98ae6a0538e4386 # v0.73.0 + uses: melodic-software/ci-workflows/.github/actions/pr-require-checks/aggregate-results@944d346c487c79eaf85dff752586fb59b0f5c539 # v0.74.0 with: results: >- ${{ needs.markdownlint.result }} From 46f47c2b0cf472b69fee39c4015c58219ed4842b Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sun, 15 Nov 2026 14:52:17 -0500 Subject: [PATCH 3/4] fix(release): anchor the sync-managed exemption to a header comment line The pin checks exempted a ci-workflows reference in any file containing the text SYNC-MANAGED FILE anywhere. The marker must now start a comment line, as it does in the three synced workflow files. The Dependabot group comment also says where a first-party major goes: it stays in first-party-actions, and the auto-merge lane does not arm it. Co-Authored-By: Claude Fable 5.2 --- .github/dependabot.yml | 8 +++++--- scripts/ReleasePinSources.ps1 | 2 +- scripts/Test-ReleasePins.ps1 | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d336c46..d220e5c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -61,9 +61,11 @@ updates: ignore: - dependency-name: "melodic-software/ci-workflows/.github/actions/check-managed-files" # The `first-party-actions` group and the `vendor-actions` group (non-major - # only) are the auto-merge lanes armed by pr-automerge-dependabot.yml; a - # dependency joins the first group that matches it, so majors fall through - # to the reviewed `github-actions` group. + # only) are the auto-merge lanes armed by pr-automerge-dependabot.yml. A + # dependency joins the first group that matches it: a vendor major falls + # through to the reviewed `github-actions` group, and a first-party major + # stays in `first-party-actions`, where the lane does not arm a pull + # request that holds a major bump, so a person merges it. groups: # Every ci-workflows composite-action pin moves in one pull request, so # the repository stays on one ci-workflows release. diff --git a/scripts/ReleasePinSources.ps1 b/scripts/ReleasePinSources.ps1 index 1cc80f4..f03f981 100644 --- a/scripts/ReleasePinSources.ps1 +++ b/scripts/ReleasePinSources.ps1 @@ -27,7 +27,7 @@ function Get-WorkflowActionPins([string] $WorkflowDirectory, [string[]] $Exclude $pins = [ordered]@{} foreach ($file in Get-ChildItem -LiteralPath $WorkflowDirectory -Filter '*.yml' -File | Sort-Object Name) { $lines = @(Get-Content -LiteralPath $file.FullName) - $syncManaged = @($lines | Where-Object { $_.Contains('SYNC-MANAGED FILE') }).Count -gt 0 + $syncManaged = @($lines | Where-Object { $_ -cmatch '^#\s*SYNC-MANAGED FILE' }).Count -gt 0 $lineNumber = 0 foreach ($line in $lines) { $lineNumber++ diff --git a/scripts/Test-ReleasePins.ps1 b/scripts/Test-ReleasePins.ps1 index 6a57a32..a05ae7a 100644 --- a/scripts/Test-ReleasePins.ps1 +++ b/scripts/Test-ReleasePins.ps1 @@ -347,7 +347,7 @@ foreach ($tool in $toolPins.GetEnumerator()) { foreach ($workflow in $workflowFiles) { $content = Get-Content -Raw -LiteralPath $workflow.FullName - $syncManaged = $content.Contains('SYNC-MANAGED FILE') + $syncManaged = [regex]::IsMatch($content, '(?m)^#\s*SYNC-MANAGED FILE') foreach ($match in [regex]::Matches($content, '(?m)^\s*uses:\s*(?[^\s#]+)')) { $reference = $match.Groups['reference'].Value if ($reference.StartsWith('./')) { From 5f34d4c4777fb5952df89c398ec1e2a6073db51f Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sun, 15 Nov 2026 14:57:35 -0500 Subject: [PATCH 4/4] test(release): anchor the sync-managed marker in the pin metadata test The test matched the marker anywhere in a workflow file, while the two PowerShell checks now need it at the start of a comment line. All three use the same anchored pattern. Co-Authored-By: Claude Fable 5.2 --- .github/scripts/workflow-pin-metadata.test.cjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/workflow-pin-metadata.test.cjs b/.github/scripts/workflow-pin-metadata.test.cjs index 57ccf05..1cd0075 100644 --- a/.github/scripts/workflow-pin-metadata.test.cjs +++ b/.github/scripts/workflow-pin-metadata.test.cjs @@ -6,7 +6,7 @@ const test = require("node:test"); const repositoryRoot = path.resolve(__dirname, "..", ".."); const workflowDirectory = path.join(repositoryRoot, ".github", "workflows"); const ciWorkflowsReference = "melodic-software/ci-workflows/"; -const syncManagedMarker = "SYNC-MANAGED FILE"; +const syncManagedMarker = /^#\s*SYNC-MANAGED FILE/mu; const canonicalReference = /^\s*uses:\s+melodic-software\/ci-workflows\/(?[^\s@#]+)@(?[0-9a-f]{40})\s+#\s+(?v(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*))\s*$/; const advisoryReference = @@ -118,7 +118,7 @@ function ciWorkflowsPin() { for (const file of workflowFiles(workflowDirectory)) { const source = fs.readFileSync(file, "utf8"); - const advisory = source.includes(syncManagedMarker); + const advisory = syncManagedMarker.test(source); const lines = source.split(/\r?\n/u); for (const [index, line] of lines.entries()) { if (!line.includes(ciWorkflowsReference)) {