Update flake.lock #25
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: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * 0' # Weekly on Sunday at midnight UTC | |
| permissions: | |
| contents: read | |
| jobs: | |
| update-flake-lock: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Mint flake update token | |
| id: flake-token | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3 | |
| with: | |
| app-id: ${{ secrets.FLAKE_UPDATE_APP_ID }} | |
| private-key: ${{ secrets.FLAKE_UPDATE_APP_PRIVATE_KEY }} | |
| owner: gastownhall | |
| repositories: beads | |
| permission-contents: write | |
| permission-pull-requests: write | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 | |
| with: | |
| ref: main | |
| token: ${{ steps.flake-token.outputs.token }} | |
| - name: Install Nix | |
| uses: DeterminateSystems/determinate-nix-action@61cbfe2efc2d4e7a8a6d56967c3c1058e846c858 # v3 | |
| - name: Update flake.lock | |
| run: nix flake update | |
| - name: Verify update scope | |
| run: | | |
| changed_files="$(git diff --name-only)" | |
| untracked_files="$(git ls-files --others --exclude-standard)" | |
| if [ -n "$untracked_files" ]; then | |
| echo "Unexpected untracked files:" | |
| echo "$untracked_files" | |
| exit 1 | |
| fi | |
| if [ -n "$changed_files" ] && [ "$changed_files" != "flake.lock" ]; then | |
| echo "Unexpected changed files:" | |
| echo "$changed_files" | |
| exit 1 | |
| fi | |
| - name: Create pull request | |
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 | |
| with: | |
| token: ${{ steps.flake-token.outputs.token }} | |
| commit-message: "flake.lock: Update" | |
| base: main | |
| branch: update_flake_lock_action | |
| delete-branch: true | |
| add-paths: flake.lock | |
| title: "chore(nix): update flake.lock" | |
| body: | | |
| Automated flake.lock update generated by the scheduled Nix workflow. |