forgejo-actions: use token to checkout for pushing to protected branch

This commit is contained in:
Christoph Hollizeck 2026-03-23 16:45:00 +01:00
parent 9acdc40003
commit 317b0bbb73

View file

@ -11,6 +11,9 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: develop ref: develop
# PUSH_TOKEN must be a PAT with write access to the repo.
# It bypasses branch protection rules that block the default GITHUB_TOKEN.
token: ${{ secrets.PUSH_TOKEN }}
- name: Update flake - name: Update flake
if: ${{ github.event_name == 'schedule' }} if: ${{ github.event_name == 'schedule' }}
run: | run: |
@ -19,8 +22,8 @@ jobs:
- name: Commit new Flake.lock - name: Commit new Flake.lock
if: ${{ github.event_name == 'schedule' }} if: ${{ github.event_name == 'schedule' }}
run: | run: |
git config --local user.email "christoph.hollizeck@hey.com" git config --local user.email "forgejo-actions[bot]@christophhollizeck.dev"
git config --local user.name "forgjo-actions[bot]" git config --local user.name "forgejo-actions[bot]"
git commit -a -m "chore: update flake" git commit -a -m "chore: update flake"
- name: Push changes - name: Push changes
if: ${{ github.event_name == 'schedule' }} if: ${{ github.event_name == 'schedule' }}