Skip to content

Commit

Permalink
Update credentials: Use git directly (#3516)
Browse files Browse the repository at this point in the history
* Use git directly

This also debugs using gh auth status when something has gone wrong. And
disables the persisting of credentails through checkout.

* Remove maintest
  • Loading branch information
simonswine authored Aug 23, 2024
1 parent 4568d68 commit d2b671d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/update-contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Update contributors
run: make update-contributors

- name: Update git credentials
run: git remote set-url origin https://x-access-token:${{ secrets.BOT_GITHUB_TOKEN }}@github.com/${{ github.repository }}

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_user_name: Pyroscope Bot
commit_user_email: [email protected]
commit_author: 'Pyroscope Bot <[email protected]>'
commit_message: 'docs: updates the list of contributors in README [skip ci]'
file_pattern: README.md
push_options: '--force-with-lease'
- name: Commit and push changes
run: |
git config --local user.name 'Pyroscope Bot'
git config --local user.email '[email protected]'
if ! git diff --exit-code README.md; then
git add README.md
git commit -m 'docs: updates the list of contributors in README [skip ci]'
gh auth status
git push --force https://x-access-token:${{ secrets.BOT_GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
fi
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}

0 comments on commit d2b671d

Please sign in to comment.