Skip to content

Fix: Pass GH_PAT to checkout to allow pushing workflow files#96

Merged
IvanildoBarauna merged 1 commit intomainfrom
fix/rollback-checkout-pat
Mar 4, 2026
Merged

Fix: Pass GH_PAT to checkout to allow pushing workflow files#96
IvanildoBarauna merged 1 commit intomainfrom
fix/rollback-checkout-pat

Conversation

@IvanildoBarauna
Copy link
Member

Problem

The git remote set-url approach wasn't working because actions/checkout@v4 configures git credentials internally via http.extraheader, which takes precedence over the remote URL and cannot be overridden with set-url.

Solution

Pass GH_PAT directly to the token parameter of actions/checkout@v4. This makes all subsequent git operations (including push) use the PAT with workflow scope, which is required to push branches containing workflow files.

Also removed the now-unnecessary git remote set-url line.

🤖 Generated with Claude Code

The actions/checkout configures git credentials internally via
http.extraheader, overriding any subsequent remote set-url.
Passing the PAT directly to the token parameter ensures all git
operations (including push) use the PAT with workflow scope.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@IvanildoBarauna IvanildoBarauna merged commit b2a0a10 into main Mar 4, 2026
4 checks passed
@IvanildoBarauna IvanildoBarauna deleted the fix/rollback-checkout-pat branch March 4, 2026 20:15
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