Skip to content

Commit

Permalink
Automatically fix the nix hash
Browse files Browse the repository at this point in the history
This pull requests lets the action directly push to the pr to fix the
nix hash.
  • Loading branch information
bkchr committed Dec 18, 2023
1 parent b5547e9 commit 5d454a5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,11 @@ jobs:
run: |
echo "If the job is failing with: \"hash mismatch in fixed-output derivation\""
echo "Copy the hash after \"got:\" and replace \"npmDepsHash\" in \"flake-module.nix\" with the hash"
! nix develop --command "exit 1" 2>&1 | grep "hash mismatch" -A2
nix develop --command "exit 1" 2>shell_output
! cat shell_output | grep "hash mismatch" -A2
# Filter the hash and then replace it in `flake-module.nix`
cat shell_output | grep "got:" | sed "s/[ \t]*got:[ \t]*//" > hash
sed "s@npmDepsHash = \"[^\"]*\"@npmDepsHash = \"$(cat hash)\"@" -i flake-module.nix
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Fix nix hash"

0 comments on commit 5d454a5

Please sign in to comment.