Repository navigation
fix(csharp-ci): restore with github.token instead of the bot PAT - #45
Merged
Merged
Conversation
Restore and pack authenticate to GitHub Packages with the job's github.token. BOT_GITHUB_TOKEN stays declared as optional and deprecated. Claude-Session: https://claude.ai/code/session_01C8uJmZ2aaTMnWXHQKWJezu
Restore sets GITHUB_TOKEN only when the run is not a fork pull request, and the build-and-test and pack checkouts use persist-credentials: false, so fork-controlled MSBuild never sees a packages: read token. README and CHANGELOG say to grant package Actions access only to private consumers; public repos resolve from nuget.org. Claude-Session: https://claude.ai/code/session_01C8uJmZ2aaTMnWXHQKWJezu
monsieurleberre
marked this pull request as ready for review
October 9, 2026 10:52
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The private GitHub Packages feed is retired and every package resolves from nuget.org, so the Restore steps carry no token and the jobs no longer need packages: read. Claude-Session: https://claude.ai/code/session_01C8uJmZ2aaTMnWXHQKWJezu
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a7bf4f8f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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
csharp-ci.yamlrandotnet restore/dotnet packwith the org-adminpeaceful-botPAT (BOT_GITHUB_TOKEN) in the step env. Those steps execute pull-request-controlled MSBuild files (Directory.Build.props,nuget.config, targets), so any same-repo PR could exfiltrate the PAT. The private GitHub Packages feed is retired and every package is on nuget.org, so restore needs no credential at all.What changed
csharp-ci.yaml: theRestoresteps (build-and-test and pack) carry noGITHUB_TOKEN/GITHUB_USERNAMEenv. Theactions/checkoutsteps usepersist-credentials: false.BOT_GITHUB_TOKENis no longer referenced by any step.[Unreleased]entry and README note updated: restore is credential-free and resolves from nuget.org; no package grants are needed. Contract-compatible (no input/output/secret change), so av2.6.x/v2.7.0cut that movesv2; the tag is the owner's to push.secrets: inheritneed no edit.BOT_GITHUB_TOKENstays declared as optional and deprecated, so a caller naming it in an explicitsecrets:block does not fail with "Invalid secret".actionlintis clean on the changed workflows.Ordering
Merge after https://github.com/peacefulstudio/dotnet-extensions-internal/pull/208 (dotnet-extensions-internal drops its
peacefulNuGet source; it calls this workflow and would otherwise lose its restore credential).https://claude.ai/code/session_01C8uJmZ2aaTMnWXHQKWJezu