corpus

Log | Files | Refs | README | LICENSE

commit 5dac304dc349fcf0399bdc709f7b68ff31615d6d
parent 4d0fb8e77a8b5ef721a2da4e41c917d668453b46
Author: mtmn <miro@haravara.org>
Date:   Wed, 22 Apr 2026 21:30:59 +0200

fix: run npmDepsHash job on each commit

Diffstat:
M.github/workflows/release-please.yml | 23-----------------------
A.github/workflows/update-nix-hash.yml | 29+++++++++++++++++++++++++++++
2 files changed, 29 insertions(+), 23 deletions(-)

diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml @@ -10,9 +10,6 @@ permissions: jobs: release-please: runs-on: ubuntu-latest - outputs: - prs_created: ${{ steps.release.outputs.prs_created }} - pr_branch: ${{ steps.release.outputs.prs_created == 'true' && fromJSON(steps.release.outputs.pr).headBranchName || '' }} steps: - uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1 id: release @@ -20,23 +17,3 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} release-type: node - update-nix-hash: - runs-on: ubuntu-latest - needs: release-please - if: ${{ needs.release-please.outputs.prs_created == 'true' }} - steps: - - uses: DeterminateSystems/nix-installer-action@da36cb69b1c3247ad7a1f931ebfd954a1105ef14 # v14 - - name: Update npmDepsHash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: ${{ needs.release-please.outputs.pr_branch }} - run: | - git clone --depth=1 --branch="$BRANCH" \ - "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git" . - hash=$(nix run nixpkgs#prefetch-npm-deps -- package-lock.json) - sed -i "s|npmDepsHash = \"sha256-[^\"]*\"|npmDepsHash = \"$hash\"|" flake.nix - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add flake.nix - git diff --staged --quiet || git commit -m "chore: update npmDepsHash" - git push diff --git a/.github/workflows/update-nix-hash.yml b/.github/workflows/update-nix-hash.yml @@ -0,0 +1,29 @@ +on: + push: + +permissions: + contents: write + +jobs: + update-nix-hash: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + ref: ${{ github.ref }} + token: ${{ secrets.GITHUB_TOKEN }} + + - uses: DeterminateSystems/nix-installer-action@da36cb69b1c3247ad7a1f931ebfd954a1105ef14 # v14 + + - name: Recompute npmDepsHash + run: | + hash=$(nix run nixpkgs#prefetch-npm-deps -- package-lock.json) + sed -i "s|npmDepsHash = \"sha256-[^\"]*\"|npmDepsHash = \"$hash\"|" flake.nix + + - name: Commit if changed + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add flake.nix + git diff --staged --quiet || git commit -m "chore: update npmDepsHash" + git push