-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (43 loc) · 1.4 KB
/
update-flake.yml
File metadata and controls
51 lines (43 loc) · 1.4 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
40
41
42
43
44
45
46
47
48
49
50
51
name: Update Flake
on:
schedule:
# Run daily at 3:00 UTC
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
update-flake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/install-nix-action@v31
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Update flake inputs
run: |
nix flake update --commit-lock-file
- name: Check if updates were made
id: check-updates
run: |
if git diff --quiet HEAD~1 HEAD -- flake.lock; then
echo "updated=false" >> $GITHUB_OUTPUT
else
echo "updated=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.check-updates.outputs.updated == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: update flake.lock"
title: "chore: update flake.lock"
body: |
Automated update of flake.lock dependencies.
This PR was automatically created by the update-flake workflow.
branch: update-flake-lock
delete-branch: true