Skip to content

Commit c4e5dbe

Browse files
committed
fix(demos): restore HTTPS remote before git push
chezmoi apply deploys ~/.gitconfig which overwrites the GITHUB_TOKEN credential setup from actions/checkout, causing git push to fail with "Permission denied (publickey)". Explicitly set HTTPS remote URL with the workflow token before pushing.
1 parent 46c983f commit c4e5dbe

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

.github/workflows/demos.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ jobs:
101101

102102
- name: Commit and push GIFs
103103
run: |
104+
# Restore HTTPS remote (chezmoi apply may overwrite ~/.gitconfig)
105+
git remote set-url origin "https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}.git"
104106
git config --local user.email "github-actions[bot]@users.noreply.github.com"
105107
git config --local user.name "github-actions[bot]"
106108
git add demos/gifs/*.gif

0 commit comments

Comments
 (0)