Skip to content

sync-branches: configure git credentials before merge/push step #29

@mrjf

Description

@mrjf

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.email are 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions