Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/maint-68-sync-consumer-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -679,9 +679,11 @@ jobs:
exit 0
fi

# Configure git
# Configure git with token-based authentication for push
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config credential.helper store
echo "https://x-access-token:${GH_TOKEN}@github.com" > ~/.git-credentials
Comment on lines +682 to +686
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The git credential helper configuration is redundant since the push command on line 705 uses a token-embedded URL directly. When using a token-embedded URL, git doesn't need to look up credentials from the credential helper. These lines can be removed to simplify the code and avoid writing credentials to disk unnecessarily.

Suggested change
# Configure git with token-based authentication for push
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config credential.helper store
echo "https://x-access-token:${GH_TOKEN}@github.com" > ~/.git-credentials
# Configure git identity for commits
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

Copilot uses AI. Check for mistakes.
Comment on lines +682 to +686
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Storing credentials in ~/.git-credentials creates a security risk in GitHub Actions. Even though the runner is ephemeral, credentials should not be written to disk when they can be passed directly in the command (as done on line 705). Additionally, the format is incorrect - the file should contain the full URL including the protocol, but this line is missing the path component after the domain. The correct format would be "https://x-access-token:${GH_TOKEN}@github.com" as a complete line.

Suggested change
# Configure git with token-based authentication for push
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config credential.helper store
echo "https://x-access-token:${GH_TOKEN}@github.com" > ~/.git-credentials
# Configure git author for commit
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"

Copilot uses AI. Check for mistakes.

# Create branch
branch="sync/workflows-${{ needs.prepare.outputs.template_hash }}"
Expand All @@ -699,8 +701,8 @@ jobs:

Changed files: ${{ steps.detect.outputs.changed_files }}"

# Push
git push origin "$branch" --force
# Push using token-authenticated URL
git push "https://x-access-token:${GH_TOKEN}@github.com/${{ matrix.repo }}.git" "$branch" --force

# Create or update PR
existing_pr=$(gh pr list --base main --head "$branch" --json number --jq '.[0].number // empty')
Expand Down
Loading