update-flake.yml

 1name: Update flake.lock
 2
 3on:
 4  push:
 5    branches: [master]
 6    paths: [go.sum]
 7  workflow_dispatch:
 8
 9permissions:
10  contents: write
11
12jobs:
13  update:
14    runs-on: ubuntu-latest
15    steps:
16      - uses: actions/checkout@v6
17
18      - uses: DeterminateSystems/nix-installer-action@main
19
20      - name: Update flake.lock
21        run: nix flake update
22
23      - name: Commit and push changes
24        env:
25          GH_TOKEN: ${{ github.token }}
26        run: |
27          git diff --quiet flake.lock && exit 0
28          git config user.name "github-actions[bot]"
29          git config user.email "github-actions[bot]@users.noreply.github.com"
30          git add .
31          git commit -m "chore: update flake.lock (#228)"
32          git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git
33          git push origin HEAD:${GITHUB_REF}