Skip to content

Commit e54bcb9

Browse files
committed
ci: add update flake workflow
1 parent ac10667 commit e54bcb9

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/update.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Update Flake
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "43 3 */10 * *" # run every ten days at 3:43 am
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
update:
14+
name: "nix flake update"
15+
runs-on: ubuntu-24.04
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
20+
with:
21+
fetch-depth: 0
22+
23+
- uses: DeterminateSystems/nix-installer-action@c5a866b6ab867e88becbed4467b93592bce69f8a # v21
24+
25+
- name: nix flake update
26+
run: |
27+
git config user.name 'github-actions[bot]'
28+
git config user.email 'github-actions[bot]@users.noreply.github.com'
29+
30+
if git ls-remote --exit-code --heads origin update; then
31+
git fetch origin update:update
32+
git checkout update
33+
git reset --hard origin/main
34+
else
35+
git checkout -b update
36+
fi
37+
38+
nix flake update --commit-lock-file
39+
40+
git push --force origin update
41+
42+
- name: Create Pull Request
43+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
44+
with:
45+
title: Update Flake
46+
branch: update
47+
base: main

0 commit comments

Comments
 (0)