update-flake-lock #50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: update-flake-lock | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 0' # Run weekly on Sunday at 00:00 | |
| permissions: | |
| contents: write | |
| jobs: | |
| lockfile: | |
| name: Update the Nix lockfile | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@master | |
| with: | |
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update flake.lock | |
| run: | | |
| nix run nixpkgs#npins -- update | |
| - name: Commit Changes | |
| id: commit | |
| continue-on-error: true | |
| run: | | |
| git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add npins | |
| git commit -m "[Automated] bump lockfile" | |
| - name: Test Changes | |
| if: steps.commit.outcome == 'success' | |
| run: | | |
| nix eval -f. --apply 'builtins.mapAttrs (_: c: c.config.system.build.toplevel)' -L --show-trace | |
| - name: Push changes | |
| if: steps.commit.outcome == 'success' | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: main |