fix(ci): add gh auth setup-git to release-plz.sh#473
Conversation
The release-plz workflow's checkout uses persist-credentials: false (set in #471), so the token isn't written to .git/config and `git push origin release --force` would 403. Mirror the workaround already applied to scripts/postversion.sh. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryAdds
Confidence Score: 5/5Safe to merge — single-line addition that directly mirrors the pattern in The change is a one-line call to No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(ci): add gh auth setup-git to releas..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request updates the scripts/release-plz.sh script to include gh auth setup-git, ensuring proper authentication for git operations when persistent credentials are disabled. The reviewer suggested explicitly specifying the hostname in the setup command to improve robustness in CI environments.
| # Configure git to use gh's credential helper. The checkout step uses | ||
| # persist-credentials: false (per zizmor's artipacked audit), so the | ||
| # token isn't written to .git/config and raw `git push` would 403. | ||
| gh auth setup-git |
There was a problem hiding this comment.
While gh auth setup-git correctly configures the credential helper for the default host, it is generally more robust in CI scripts to explicitly specify the hostname to avoid ambiguity or potential prompts in environments with multiple configured hosts.
| gh auth setup-git | |
| gh auth setup-git --hostname github.com |
Summary
persist-credentials: false, so the token isn't written to.git/configandgit push origin release --forcein scripts/release-plz.sh would 403.gh auth setup-gitafter thegit config user.{name,email}block, before anygit push.Flagged by Cursor Bugbot on #471 (review).
Test plan
workflow_dispatch) successfully pushes thereleasebranch without a 403.🤖 Generated with Claude Code
Note
Low Risk
Low risk CI-only change that affects the release automation path; main impact is whether the workflow can successfully push the
releasebranch.Overview
Fixes the
scripts/release-plz.shrelease automation to rungh auth setup-gitafter setting the git author, ensuringgit pushworks whenactions/checkoutusespersist-credentials: false.This prevents 403 failures when pushing the forced
releasebranch during automated version bump PR creation.Reviewed by Cursor Bugbot for commit f694191. Bugbot is set up for automated code reviews on this repo. Configure here.