-
Notifications
You must be signed in to change notification settings - Fork 0
sync-branches: configure git credentials before merge/push step #29
Copy link
Copy link
Open
Description
Problem
The sync-branches workflow runs git merge and git push to update autoloop/* branches, but git author identity and authenticated remote credentials may not be configured at that point.
- Merge commits can fail if
user.name/user.emailare not set (git refuses to create a merge commit without an identity). - Push/fetch can fail if the remote URL isn't authenticated (the default checkout URL may not carry the token).
Where
.github/workflows/sync-branches.md — the merge/push Python script runs directly without a prior credentials setup step.
Proposed fix
Configure git identity and credentials before the merge script runs:
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"This can be a separate step before the merge script, or inlined at the top of the existing Python script via subprocess.run.
Origin
Flagged by Copilot code review on github/gh-aw#24345.
Reactions are currently unavailable