Skip to content

ci: make the Dependabot heal workflow actually finish the job - #129

Merged
Theauxm merged 1 commit into
mainfrom
ci/dependabot-self-heal
Sep 17, 2026
Merged

Theauxm merged 1 commit into
mainfrom
ci/dependabot-self-heal

Conversation

@Theauxm

@Theauxm Theauxm commented Sep 17, 2026

Copy link
Copy Markdown
Member

Same change proven on Trax.Mediator, where it healed #84 end to end.

The old workflow could never land a commit: it used git push, and the org ruleset requires verified signatures, which a runner has no key for. It now writes through the createCommitOnBranch GraphQL mutation, which GitHub signs itself, so the heal lands Verified with no signing key in CI.

It also only ever fixed lockfiles. Dependabot rewrites project files on a grouped bump: when the transitive graph resolves one package at different versions across projects, it adds <PackageReference ... VersionOverride="..."> to projects that never referenced it, several pinned to the version being bumped away from. The last grouped bump here injected eight of those across nine csproj files. Nothing reverted them, so lockfiles regenerated on top of the injection. The revert is re-derived with git in the committing job rather than trusted from the patch, so the job that runs dependency code still hands over nothing but lockfiles.

The regenerating restore now passes -p:NuGetAudit=false. Directory.Build.props promotes NU1901-NU1904 to errors, so an advisory anywhere in the graph aborted the regeneration, which is precisely the state a security bump arrives in. The PR build still audits.

It keeps authenticating with GITHUB_TOKEN rather than an App token or a PAT. Either would avoid the "Approve and run" press on the run that follows the write, but both mean a long-lived credential in Dependabot secrets, and an App private key never expires and can mint write tokens for every repo it is installed on. GITHUB_TOKEN stores nothing.

On the config side, csharpier is ignored: it lives in .config/dotnet-tools.json, a minor bump changes how it formats, and the bump and the repo-wide reformat have to be one commit, which a bot PR cannot do. Roslyn moves to its own group so that when its bump does need a human it does not take the rest of the week's updates with it, and the PR limit drops to three.

Same change proven on Trax.Mediator, where it healed #84 end to end.

The old workflow could never land a commit: it used `git push`, and the org
ruleset requires verified signatures, which a runner has no key for. It now
writes through the createCommitOnBranch GraphQL mutation, which GitHub signs
itself, so the heal lands Verified with no signing key in CI.

It also only ever fixed lockfiles. Dependabot rewrites project files on a
grouped bump: when the transitive graph resolves one package at different
versions across projects, it adds <PackageReference ... VersionOverride="...">
to projects that never referenced it, several pinned to the version being
bumped away from. The last grouped bump here injected eight of those across
nine csproj files. Nothing reverted them, so lockfiles regenerated on top of
the injection. The revert is re-derived with git in the committing job rather
than trusted from the patch, so the job that runs dependency code still hands
over nothing but lockfiles.

The regenerating restore now passes -p:NuGetAudit=false. Directory.Build.props
promotes NU1901-NU1904 to errors, so an advisory anywhere in the graph aborted
the regeneration, which is precisely the state a security bump arrives in. The
PR build still audits.

It keeps authenticating with GITHUB_TOKEN rather than an App token or a PAT.
Either would avoid the "Approve and run" press on the run that follows the
write, but both mean a long-lived credential in Dependabot secrets, and an App
private key never expires and can mint write tokens for every repo it is
installed on. GITHUB_TOKEN stores nothing.

On the config side, csharpier is ignored: it lives in .config/dotnet-tools.json,
a minor bump changes how it formats, and the bump and the repo-wide reformat
have to be one commit, which a bot PR cannot do. Roslyn moves to its own group
so that when its bump does need a human it does not take the rest of the week's
updates with it, and the PR limit drops to three.
@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Theauxm
Theauxm merged commit b59bce6 into main Sep 17, 2026
4 checks passed
@Theauxm
Theauxm deleted the ci/dependabot-self-heal branch September 17, 2026 17:31
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