File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 1010
1111jobs :
1212 build :
13+ permissions :
14+ contents : write
1315 runs-on : ubuntu-latest
1416
1517 steps :
1618 - uses : actions/checkout@v3
1719 with :
1820 fetch-depth : 2
1921
20- - uses : cachix/install-nix-action@v16
22+ - uses : DeterminateSystems/nix-installer-action@main
23+ with :
24+ determinate : true
2125
2226 - name : Run build
2327 run : nix build
28+
29+ - name : Fix hash mismatches
30+ if : failure() && github.event_name == 'pull_request'
31+ id : fix-hashes
32+ run : |
33+ git stash --include-untracked
34+ git fetch --depth=1 origin "$GITHUB_HEAD_REF"
35+ git checkout -B "$GITHUB_HEAD_REF" "${{ github.event.pull_request.head.sha }}"
36+
37+ determinate-nixd fix hashes --auto-apply
38+
39+ if ! git diff --quiet; then
40+ git config user.name "github-actions[bot]"
41+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
42+ git add --update --ignore-removal .
43+ git commit -m "[dependabot skip] Automatically fix Nix hashes"
44+ git push origin "$GITHUB_HEAD_REF"
45+ fi
46+
47+ git checkout -
48+ git stash pop || true
You can’t perform that action at this time.
0 commit comments