Skip to content

Commit

Permalink
actions: automatic nix flake updates
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzBischof committed Jan 19, 2025
1 parent 58cb76e commit 84e4b26
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/update.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# https://xyven.dev/articles/automatic-flake-updates-with-garnix
name: "update"

on:
workflow_dispatch: # allows manual triggering
schedule: # run the job at 04:00 every 3 days
- cron: '0 4 */3 * *'

jobs:
update:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
# We set our custom GitHub token for any private flake inputs we might have
github-token: ${{ secrets.GH_TOKEN }}
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
id: update
with:
commit-msg: "flake: update"
pr-title: "flake: update"
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
- run: |
if [ -n "${{ steps.update.outputs.pull-request-number }}" ]; then
gh pr merge --auto --rebase ${{ steps.update.outputs.pull-request-number }}
fi
env:
GH_TOKEN: ${{ github.token }}

0 comments on commit 84e4b26

Please sign in to comment.