Skip to content

fix(release-pr): stage the version-stamped scorecard doc#413

Merged
ozzyfromspace merged 1 commit into
mainfrom
fix/release-pr-stage-scorecard
Jun 14, 2026
Merged

fix(release-pr): stage the version-stamped scorecard doc#413
ozzyfromspace merged 1 commit into
mainfrom
fix/release-pr-stage-scorecard

Conversation

@ozzyfromspace

Copy link
Copy Markdown
Contributor

What went wrong

The Prepare Release PR workflow (run 27491924549) failed at the Stage bump step with exit 1:

Unexpected files staged for release commit:
  CHANGELOG.md, RELEASES.md, docs/scorecard/cii-best-practices-answers.md, package.json
Expected exactly: CHANGELOG.md, RELEASES.md, package.json

Root cause: #409 ("stamp version at release") added scripts/sync-doc-versions.mjs and extended the version npm hook to stamp and git add docs/scorecard/cii-best-practices-answers.md. But it never updated release-pr.yml, which hard-coded a "three bump files" list in two places. The scorecard's current: marker changes on every bump, so it always lands staged as a fourth file and trips the Stage bump allow-list. (A latent second copy of the stale list in Create signed bump commit's additions array would have silently dropped the scorecard from the commit even if Stage bump had passed.) No release PR could open until this is fixed.

The fix

Root-cause the whole "two lists drifted out of sync" class by deriving the file set from the index instead of re-hard-coding it:

  • Stage bump asserts a required set (CHANGELOG.md, RELEASES.md, package.json) plus an allowed-but-not-required slot for the stamped scorecard doc, and rejects anything outside the allow-list. The optional treatment matches sync-doc-versions.mjs's deliberate "never block on it" tolerance: if the doc's marker is ever re-worded away, the release still proceeds.
  • Create signed bump commit builds additions from the staged index (git diff --cached --name-only -z), keeping it in lock-step with that assertion. A future stamp target can never silently fall off the commit again.
  • Updated the now-truthful PR-body "What changed" list and a couple of stale comments.

Validation

  • YAML parses; zizmor (pedantic) — the CI gate — reports no findings.
  • Unit-tested the staging invariant: 4-files-with-scorecard → pass, 3-required-only → pass, stray src/ file → fail, missing package.json → fail.
  • Syntax-checked and exercised the Node additions builder against a throwaway staged repo.

End-to-end coverage requires a real workflow_dispatch; the logic is exercised as closely as possible without one.

🤖 Generated with Claude Code

The `version` npm hook (since #409) stamps and `git add`s
docs/scorecard/cii-best-practices-answers.md, but release-pr.yml still
hard-coded a three-file bump allow-list in two places. The scorecard's
`current:` marker changes on every bump, so it always landed as a fourth
staged file and tripped the Stage bump assertion, blocking the release
PR (run 27491924549).

Derive the file set from the index instead of re-hard-coding it: Stage
bump asserts a required set (CHANGELOG.md, RELEASES.md, package.json)
plus an allowed-but-not-required slot for stamped docs, and Create
signed bump commit builds its additions from the staged index so the
two lists can no longer drift. The optional treatment matches
sync-doc-versions's deliberate "never block on it" tolerance.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
attaform Ready Ready Preview, Comment Jun 14, 2026 7:46am

@ozzyfromspace ozzyfromspace merged commit 9f030e3 into main Jun 14, 2026
15 checks passed
@ozzyfromspace ozzyfromspace deleted the fix/release-pr-stage-scorecard branch June 14, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant