mirror of
https://github.com/dwinkler1/fran.git
synced 2026-02-19 22:50:59 -05:00
Add workflow to fix Nix hash mismatches
This commit is contained in:
parent
49ea78bf98
commit
d834f360bf
1 changed files with 38 additions and 0 deletions
38
.github/workflows/fix_hashes.yml
vendored
Normal file
38
.github/workflows/fix_hashes.yml
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
id-token: read
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: DeterminateSystems/determinate-nix-action@v3
|
||||||
|
|
||||||
|
- uses: DeterminateSystems/flakehub-cache-action@main
|
||||||
|
|
||||||
|
- run: nix flake check -L
|
||||||
|
|
||||||
|
- name: Fix hash mismatches
|
||||||
|
if: failure() && github.event_name == 'pull_request'
|
||||||
|
id: fix-hashes
|
||||||
|
run: |
|
||||||
|
git stash --include-untracked
|
||||||
|
git fetch --depth=1 origin "$GITHUB_HEAD_REF"
|
||||||
|
git checkout -B "$GITHUB_HEAD_REF" "${{ github.event.pull_request.head.sha }}"
|
||||||
|
|
||||||
|
determinate-nixd fix hashes --auto-apply
|
||||||
|
|
||||||
|
if ! git diff --quiet; then
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
git add --update --ignore-removal .
|
||||||
|
git commit -m "[dependabot skip] Automatically fix Nix hashes"
|
||||||
|
git push origin "$GITHUB_HEAD_REF"
|
||||||
|
fi
|
||||||
|
|
||||||
|
git checkout -
|
||||||
|
git stash pop || true
|
||||||
Loading…
Add table
Add a link
Reference in a new issue