-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (43 loc) · 1.28 KB
/
update.yml
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
name: Update inputs
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
main:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- uses: DeterminateSystems/nix-installer-action@v12
- name: Update inputs
id: update
run: |
old="$(sha256sum flake.lock)"
nix flake update
new="$(sha256sum flake.lock)"
if [ "$old" != "$new" ]; then
echo "trigger-build=true" >> $GITHUB_OUTPUT
fi
- name: Trigger build
if: ${{ steps.update.outputs.trigger-build }}
uses: actions/github-script@v7.0.1
with:
script: |
github.rest.repos.createDispatchEvent({
owner: context.repo.owner,
repo: context.repo.repo,
event_type: 'trigger-build',
});
- name: Commit flake update
if: ${{ steps.update.outputs.trigger-build }}
uses: planetscale/ghcommit-action@v0.1.39
with:
commit_message: "🤖 Update inputs"
repo: ${{ github.repository }}
branch: ${{ github.head_ref || github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}