on: 
  schedule:
    - cron: 0 */6 * * *
  
jobs:
  UpdateFlake:
    runs-on: native

    steps:
      - name: Check out repository code
        uses: actions/checkout@v4
      - name: Update flake
        run: | 
          cd ${{ gitea.workspace }}
          nix flake update
      - name: Commit new Flake.lock
        run: |
          git config --local user.email "christoph.hollizeck@hey.com"
          git config --local user.name "forgjo-actions[bot]"
          git commit -a -m "chore: update flake"
      - name: Push changes
        run: git push
