fix: persist credentials for git push in update-major-minor-tags workflow#312
Merged
eifinger merged 1 commit intoastral-sh:mainfrom Jan 30, 2026
Merged
Conversation
f420615 to
926f020
Compare
…flow actions/checkout@v6 changed behavior - when persist-credentials is false, credentials are immediately cleaned up after checkout. This caused the git push commands to fail with 'could not read Username' error. Setting persist-credentials: true keeps the token available for the git push operations. The workflow already has minimal permissions (contents: write) scoped only to this job. Refs: https://github.com/astral-sh/ruff-action/actions/runs/21509988231/job/61974754475
926f020 to
e0255e6
Compare
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.
Problem
After upgrading to
actions/checkout@v6, theupdate-major-minor-tagsworkflow fails with:Example: https://github.com/astral-sh/ruff-action/actions/runs/21509988231/job/61974754475
Root Cause
actions/checkout@v6changed the behavior ofpersist-credentials: false. In v6, credentials are immediately cleaned up after checkout, whereas in v5 they remained available during the job.The workflow sets
persist-credentials: falseand then tries togit push— but the auth credentials are already gone.Fix
Explicitly set
persist-credentials: true(removing thefalsevalue). The workflow already has minimal permissions (contents: write) scoped only to this job, so this is safe.Added a
zizmor: ignore[artipacked]comment in case the security linter flags this pattern.