Skip to content

test: guard the release wiring that fails silently - #20

Merged
CaffeinatedCoder merged 2 commits into
mainfrom
test/release-wiring-conventions
Aug 16, 2026
Merged

CaffeinatedCoder merged 2 commits into
mainfrom
test/release-wiring-conventions

Conversation

@CaffeinatedCoder

Copy link
Copy Markdown
Owner

Why

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. CodoMetis.ValueRanges has had these guards since its hardening PR; this repo, where the pattern originated, did not.

What

ReleaseWiringConventionTests (7), ported and extended:

guard fails when
release.yml exists under that name the workflow is renamed/moved
publish job gated on environment: nuget the environment is renamed
only publish holds id-token: write any other job requests an id-token
no job holds both id-token: write and contents: write the boundary #17 relies on is collapsed
tag checked against Directory.Build.props the check is removed/reworded
cyclonedx pinned in the tool manifest dotnet tool restore would silently do nothing
no scripts/*publish* a second publishing path appears

Job bodies are sliced by their two-space-indented keys; every assertion matches YAML keys, not words — the verify job'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)

  • All seven pass against main's two-job release.yml and against the three-job shape from ci: attach the SBOMs to the GitHub release #17.
  • Each seeded defect fails exactly one test: environment renamed; verify given id-token: write; publish given contents: write; publish stripped of id-token; tag check reworded; cyclonedx removed from the manifest; scripts/publish-nuget.sh added.
  • ClaudeMdConsistencyTests passes with the new table row.

🤖 Generated with Claude Code

CaffeinatedCoder and others added 2 commits August 16, 2026 13:32
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>
@CaffeinatedCoder
CaffeinatedCoder merged commit 024c87a into main Aug 16, 2026
9 checks passed
@CaffeinatedCoder
CaffeinatedCoder deleted the test/release-wiring-conventions branch August 16, 2026 13:26
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