Skip to content

Commit 0bd0f06

Browse files
fix: use provided github-token for writeback push
The writeback git push was using the default GITHUB_TOKEN (set up by actions/checkout), which cannot bypass branch protection rules even when the PAT owner is configured as a bypass actor. Switch the remote URL to authenticate with inputs.github-token (typically a PAT with repo scope) so the push is attributed to the token owner and respects their bypass permissions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a084ff7 commit 0bd0f06

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,16 @@ runs:
9191
- name: Commit writeback changes
9292
if: inputs.writeback == 'true' && inputs.dry-run != 'true'
9393
shell: bash
94+
env:
95+
GH_TOKEN: ${{ inputs.github-token }}
9496
run: |
9597
if git diff --quiet "${{ inputs.tasks-file }}"; then
9698
echo "No writeback changes to commit"
9799
exit 0
98100
fi
99101
git config user.name "tasksmd-sync[bot]"
100102
git config user.email "tasksmd-sync[bot]@users.noreply.github.com"
103+
git remote set-url origin "https://x-access-token:${{ inputs.github-token }}@github.com/${{ github.repository }}.git"
101104
git add "${{ inputs.tasks-file }}"
102105
git commit -m "chore: write back board item IDs to ${{ inputs.tasks-file }}"
103106
git push

0 commit comments

Comments
 (0)