|
| 1 | +name: 'Scheduled: Nix flake update' |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + # Run every Monday at 09:00 UTC (same as Dependabot) |
| 6 | + - cron: '0 9 * * 1' |
| 7 | + workflow_dispatch: # Allow manual trigger |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: write |
| 11 | + pull-requests: write |
| 12 | + |
| 13 | +jobs: |
| 14 | + update-flake: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Checkout repository |
| 18 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 19 | + |
| 20 | + - name: Setup Nix |
| 21 | + uses: ./.github/actions/setup-nix |
| 22 | + |
| 23 | + - name: Update flake.lock |
| 24 | + run: nix flake update |
| 25 | + |
| 26 | + - name: Check if flake.lock changed |
| 27 | + id: check-changes |
| 28 | + run: | |
| 29 | + if git diff --quiet flake.lock; then |
| 30 | + echo "changed=false" >> $GITHUB_OUTPUT |
| 31 | + else |
| 32 | + echo "changed=true" >> $GITHUB_OUTPUT |
| 33 | + fi |
| 34 | +
|
| 35 | + - name: Create Pull Request |
| 36 | + id: create-pr |
| 37 | + if: steps.check-changes.outputs.changed == 'true' |
| 38 | + uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0 |
| 39 | + with: |
| 40 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 41 | + commit-message: 'chore(deps): update nix flake inputs' |
| 42 | + title: 'chore(deps): update nix flake inputs' |
| 43 | + body: | |
| 44 | + ## Summary |
| 45 | + - Automated update of Nix flake inputs (`nixpkgs`, `flake-parts`) |
| 46 | +
|
| 47 | + ## Test plan |
| 48 | + - [ ] `nix flake check` passes in CI |
| 49 | + - [ ] Development shell works correctly |
| 50 | +
|
| 51 | + --- |
| 52 | + 🤖 This PR was automatically created by the scheduled Nix flake update workflow. |
| 53 | + branch: chore/nix-flake-update |
| 54 | + labels: | |
| 55 | + dependencies |
| 56 | + nix |
| 57 | + delete-branch: true |
| 58 | + |
| 59 | + - name: Enable auto-merge |
| 60 | + if: steps.create-pr.outputs.pull-request-number |
| 61 | + run: gh pr merge --auto --squash "${{ steps.create-pr.outputs.pull-request-url }}" |
| 62 | + env: |
| 63 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments