-
Notifications
You must be signed in to change notification settings - Fork 22
53 lines (45 loc) · 1.39 KB
/
nix-fix.yml
File metadata and controls
53 lines (45 loc) · 1.39 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
52
53
name: Fix PNPM Dependency Hash
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build-nix:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Get changed files
id: changed-files
uses: dorny/paths-filter@v3
with:
filters: |
files:
- 'flake.nix'
- 'nix/package.nix'
- 'package.json'
- 'pnpm-lock.yaml'
- uses: DeterminateSystems/nix-installer-action@main
if: steps.changed-files.outputs.files == 'true'
- uses: DeterminateSystems/magic-nix-cache-action@main
if: steps.changed-files.outputs.files == 'true'
- if: steps.changed-files.outputs.files == 'true'
run: |
if nix build -Lv --no-link .#vermilion 2> /tmp/log; then
exit 0
fi
hash="$(grep 'got:' /tmp/log | awk '{print $2}')"
echo "hash=$hash"
sed -e "s#hash =.*\$#hash = \"$hash\";#g" -i nix/package.nix
git diff
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "[CI]: update pnpm dependency hash"
file_pattern: 'nix/package.nix'