From c8f565166b77b140961683c4c308511b9ea256e3 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sun, 14 Jun 2026 22:42:34 -0300 Subject: [PATCH] fix: replace update-flake-lock to drop Node.js 20 sub-actions DeterminateSystems/update-flake-lock pulls in four sub-actions still on the Node.js 20 runtime, which GitHub forces to Node.js 24 on 2026-06-16 and removes entirely on 2026-09-16. Its latest release (v28) still pins all four, and the two leaf actions doing PR-body templating have no Node.js 24 release at all, so bumping the dependency cannot fix it. Reimplement the step inline: `nix flake update --commit-lock-file` (pure Nix, no Node) produces the lock change and its per-input changelog, which becomes the PR body; peter-evans/create-pull-request@v8 (Node.js 24) opens the PR. Only one Node action remains in the chain and it runs on Node.js 24. Also add pr-title and pr-branch inputs (defaults preserve the previous title and branch name) so the PR title / commit summary and head branch are configurable. --- update-flake/action.yml | 48 +++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/update-flake/action.yml b/update-flake/action.yml index 4fb6fc7..d64c522 100644 --- a/update-flake/action.yml +++ b/update-flake/action.yml @@ -46,6 +46,14 @@ inputs: default: | dependencies automated + pr-title: + description: "Title of the PR, and the flake.lock commit summary." + required: false + default: "Update flake.lock" + pr-branch: + description: "Head branch the action pushes the update PR to." + required: false + default: "update_flake_lock_action" auto-merge: description: '"true" to enable PR auto-merge after creation.' required: false @@ -97,16 +105,44 @@ runs: - name: Update flake.lock id: update - uses: DeterminateSystems/update-flake-lock@v28 + shell: bash + env: + PR_TITLE: ${{ inputs.pr-title }} + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + tip="$(git rev-parse HEAD)" + nix flake update --commit-lock-file \ + --commit-lock-file-summary "$PR_TITLE" + if [ "$tip" != "$(git rev-parse HEAD)" ]; then + # Grab Nix's per-input changelog from its commit, then unwind it so + # create-pull-request makes the real commit/branch/author. + { + echo "updated=true" + echo "body<<__NIX_BODY_EOF__" + git log -1 --format=%b + echo "__NIX_BODY_EOF__" + } >> "$GITHUB_OUTPUT" + git reset --soft "$tip" + fi + + - name: Create PR + id: create-pr + if: steps.update.outputs.updated == 'true' + uses: peter-evans/create-pull-request@v8 with: token: ${{ steps.app-token.outputs.token || github.token }} - pr-title: "Update flake.lock" - pr-labels: ${{ inputs.pr-labels }} - pr-reviewers: ${{ inputs.reviewers }} + base: ${{ inputs.base-branch }} + branch: ${{ inputs.pr-branch }} + delete-branch: true + title: ${{ inputs.pr-title }} + body: ${{ steps.update.outputs.body }} + labels: ${{ inputs.pr-labels }} + reviewers: ${{ inputs.reviewers }} - name: Auto merge - if: inputs.auto-merge == 'true' && steps.update.outputs.pull-request-number != '' + if: inputs.auto-merge == 'true' && steps.create-pr.outputs.pull-request-number != '' shell: bash - run: gh pr merge --auto --${{ inputs.merge-method }} ${{ steps.update.outputs.pull-request-number }} + run: gh pr merge --auto --${{ inputs.merge-method }} ${{ steps.create-pr.outputs.pull-request-number }} env: GH_TOKEN: ${{ steps.app-token.outputs.token || github.token }}