Skip to content

Commit b70603c

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

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/update.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
flake-update:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
19+
with:
20+
fetch-depth: 0
21+
22+
- uses: DeterminateSystems/nix-installer-action@c5a866b6ab867e88becbed4467b93592bce69f8a # v21
23+
24+
- name: Set up Git user
25+
run: |
26+
git config user.name 'github-actions[bot]'
27+
git config user.email 'github-actions[bot]@users.noreply.github.com'
28+
29+
- name: Create or switch to 'update' branch
30+
run: |
31+
git branch -f update origin/main
32+
git checkout update
33+
34+
- name: nix flake update
35+
run: nix flake update --commit-lock-file
36+
37+
- name: Push changes
38+
run: git push --force-with-lease origin update
39+
40+
- name: Create Pull Request
41+
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
42+
with:
43+
title: Update Flake
44+
branch: update
45+
base: main

0 commit comments

Comments
 (0)