Skip to content

Commit 059d94c

Browse files
committed
Auto-update flake.lock/Cargo.lock once a week
1 parent 11114b8 commit 059d94c

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

.github/workflows/update.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Update
2+
on:
3+
schedule:
4+
- cron: "0 9 * * *"
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
update:
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- uses: cachix/install-nix-action@v31
16+
- uses: actions/checkout@v6
17+
- run: nix flake update 2> >(tee nix-flake-update.txt >&2)
18+
- run: cargo update 2> >(tee cargo-lock.txt >&2)
19+
- run: nix flake check --print-build-logs
20+
- id: body
21+
run: |
22+
{
23+
echo 'body<<EOF'
24+
echo "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
25+
echo '```'
26+
cat nix-flake-update.txt
27+
echo '```'
28+
echo '```'
29+
cat cargo-lock.txt
30+
echo '```'
31+
echo 'EOF'
32+
} >> "$GITHUB_OUTPUT"
33+
- uses: peter-evans/create-pull-request@v8
34+
with:
35+
add-paths: |
36+
flake.lock
37+
Cargo.lock
38+
commit-message: Update `flake.lock` and `Cargo.lock`
39+
branch: update
40+
title: Update `flake.lock` and `Cargo.lock`
41+
body: ${{ steps.body.outputs.body }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.DS_Store
22
/.direnv/
33
/.envrc
4+
/cargo-lock.txt
5+
/nix-flake-update.txt
46
/result*
57
/target/

0 commit comments

Comments
 (0)