test: guard the release wiring that fails silently - #20
Merged
Merged
Conversation
Trusted Publishing matches on the workflow file name, the environment and the repository — none of which the build knows about. Rename release.yml or the `nuget` environment and every check stays green; the next tag fails to publish with an authentication error that never mentions the rename. The job split has the same shape: nothing stopped a later edit from handing the unattended verify job an id-token, or one job both the token and repository write access. ReleaseWiringConventionTests, ported from CodoMetis.ValueRanges and extended: release.yml exists under that name; the publish job is gated on `environment: nuget`; only the publish job holds id-token: write; no job holds both id-token: write and contents: write (the boundary the release job introduced in #17 relies on); the tag is checked against Directory.Build.props; cyclonedx is pinned in the tool manifest; nothing matching *publish* exists under scripts/. Job bodies are sliced by their two-space-indented keys and every assertion matches YAML keys, not words — the verify job's comment says "id-token" precisely to explain why it has none. Verified: all seven pass against main's two-job release.yml and against the three-job shape from #17; each seeded defect — environment renamed, verify given id-token, publish given contents: write, publish stripped of id-token, tag check reworded, cyclonedx removed from the manifest, a scripts/publish-nuget.sh added — fails exactly one test. ClaudeMdConsistencyTests passes with the new table row. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…onventions # Conflicts: # CLAUDE.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Trusted Publishing matches on the workflow file name, the environment and the repository — none of which the build knows about. Rename
release.ymlor thenugetenvironment and every check stays green; the next tag fails to publish with an authentication error that never mentions the rename. The job split has the same shape: nothing stopped a later edit from handing the unattendedverifyjob anid-token, or one job both the token and repository write access. CodoMetis.ValueRanges has had these guards since its hardening PR; this repo, where the pattern originated, did not.What
ReleaseWiringConventionTests(7), ported and extended:release.ymlexists under that nameenvironment: nugetpublishholdsid-token: writeid-token: writeandcontents: writeDirectory.Build.propsdotnet tool restorewould silently do nothingscripts/*publish*Job bodies are sliced by their two-space-indented keys; every assertion matches YAML keys, not words — the
verifyjob's comment says "id-token" precisely to explain why it has none, and a substring search would read that as the permission it warns against.Verified (verify-the-guard)
main's two-jobrelease.ymland against the three-job shape from ci: attach the SBOMs to the GitHub release #17.verifygivenid-token: write;publishgivencontents: write;publishstripped ofid-token; tag check reworded;cyclonedxremoved from the manifest;scripts/publish-nuget.shadded.ClaudeMdConsistencyTestspasses with the new table row.🤖 Generated with Claude Code