ci: isolate release credentials and pin the dependency graph#26
Merged
Conversation
Split the release workflow into build-test, release, and publish jobs along trust boundaries so untrusted build code never runs with a publish credential. Default workflow permissions to none, pin every action to a commit SHA, and add harden-runner egress auditing. Publishing moves to NuGet trusted publishing (OIDC, short-lived key) with SLSA build provenance instead of a stored API key. Adopt Central Package Management: package versions move to Directory.Packages.props and each project commits a packages.lock.json, restored in CI with --locked-mode. A guard step fails the build on any lockfile carrying the local-dev 1.99.99 version. Turn on DotNet.ReproducibleBuilds.
Theauxm
force-pushed
the
harden/github-actions-security
branch
from
July 2, 2026 16:31
74dc47b to
26bac70
Compare
Central Package Management collapsed Microsoft.CodeAnalysis.CSharp to 4.14 but left Workspaces at 4.12, so the analyzer built against 4.14 failed CS1705 against its test project's 4.12 assemblies. Align Workspaces to 4.14. Also enable NuGetAudit all-mode and treat NU1901-NU1904 as errors.
The RepoConvention guard self-test still built its "conforming" synthetic repo with an inline Trax.Effect Version="1.*", which the CPM-updated guard now correctly flags, so the self-test failed in CI. Rewrite the fixture to the CPM convention (versionless Trax ref + a central PackageVersion pin) and rename the stale test method. Add coverlet.collector to the analyzer test project so it stops emitting the missing- datacollector warning and reports coverage.
|
This PR is included in version 1.6.1 |
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.
Split the release workflow into build-test, release, and publish jobs along trust boundaries so untrusted build code never runs with a publish credential. Default workflow permissions to none, pin every action to a commit SHA, and add harden-runner egress auditing. Publishing moves to NuGet trusted publishing (OIDC, short-lived key) with SLSA build provenance instead of a stored API key.
Adopt Central Package Management: package versions move to Directory.Packages.props and each project commits a packages.lock.json, restored in CI with --locked-mode. A guard step fails the build on any lockfile carrying the local-dev 1.99.99 version. Turn on DotNet.ReproducibleBuilds.