-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.19 KB
/
Copy pathflake-lock-update.yaml
File metadata and controls
39 lines (39 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Update flake.lock
on:
workflow_dispatch:
schedule:
- cron: "0 6 */3 * *"
jobs:
update-flake-lock:
name: Update flake.lock
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Update flake.lock
run: |
nix flake update
- name: Check if update is needed
id: check
run: |
if git diff --quiet -- flake.lock; then
echo "should_update=false" >>"$GITHUB_OUTPUT"
else
echo "should_update=true" >>"$GITHUB_OUTPUT"
fi
- name: Validate builds
if: steps.check.outputs.should_update == 'true'
run: |
nix build --accept-flake-config .#t3code .#t3code-appimage .#t3code-with-codex .#t3code-appimage-with-codex
- name: Commit changes
if: steps.check.outputs.should_update == 'true'
uses: stefanzweifel/git-auto-commit-action@v6
with:
commit_message: "update: flake.lock"
file_pattern: "flake.lock"