Skip to content

Commit fee8df2

Browse files
pattonwebzclaude
andcommitted
Keep GITHUB_TOKEN out of .git/config during the dist build
Flagged by CodeRabbit on the multisite PR; applies identically here. The job runs `npm install` and the webpack/composer dist build against the checkout, and actions/checkout persists the GITHUB_TOKEN into .git/config by default, so that build executes with a usable push credential sitting in the working tree. Verified this is safe rather than assuming it: create-pull-request calls GitConfigHelper.configureToken() with its own `token` input (defaulting to github.token) and sets its own http.<host>/.extraheader before pushing - it even saves and unsets any persisted extraheader first, then restores it afterwards. So the PR step supplies its own auth and does not read what checkout persisted. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019LoLgW7oFjBPxGea9kiZJ2
1 parent 127ca3a commit fee8df2

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/make-pot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ jobs:
2424
uses: actions/checkout@v4
2525
with:
2626
ref: ${{ github.event.inputs.base || github.ref_name }}
27+
# The dist build runs npm and composer against this checkout, so the
28+
# GITHUB_TOKEN is kept out of .git/config. create-pull-request does
29+
# not need it: it configures its own http.<host>/.extraheader from
30+
# its `token` input when it pushes.
31+
persist-credentials: false
2732

2833
- name: Set up Node.js
2934
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)