From 4776d22c2c751ba08e32652ff3b68b4d783fd2ba Mon Sep 17 00:00:00 2001 From: Ray Walker Date: Mon, 27 Jul 2026 00:11:58 +1000 Subject: [PATCH] ci: stop fromJson('') in assign-step env from failing release job on non-release pushes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Step env: templates are evaluated when the step is materialized, regardless of the if: guard. On any push to main where release-please creates/updates no release PR, steps.release.outputs.pr is empty and fromJson('') throws a template error that fails the release-please job — which skips the publish job (needs: release-please). Since the push that merges a release PR also has an empty pr output, the next real release would tag on GitHub but never publish to crates.io. Select the release PR by release-please's deterministic head branch (release-please--branches--main--components--cachekit-core, verified against release PRs #38 and #49) instead of parsing the PR number in a template position that can see an empty string. Closes LAB-865 --- .github/workflows/release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index aac8522..b5514fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,12 +41,15 @@ jobs: # release PR here. outputs.pr is set whenever the release PR was created # OR updated, so this re-runs on every push to main while a release PR is # open — adding an already-present assignee is a no-op, so that's safe. + # The PR is selected by release-please's deterministic head branch, NOT + # fromJson(outputs.pr).number: step env templates are evaluated even when + # if: is false, so fromJson('') on a no-release push fails the whole job + # and skips publish (LAB-865). - name: Assign release PR to 27Bslash6 if: ${{ steps.release.outputs.pr }} - run: gh pr edit "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --add-assignee 27Bslash6 + run: gh pr edit "release-please--branches--main--components--cachekit-core" --repo "$GITHUB_REPOSITORY" --add-assignee 27Bslash6 env: GH_TOKEN: ${{ steps.app-token.outputs.token }} - PR_NUMBER: ${{ fromJson(steps.release.outputs.pr).number }} publish: needs: release-please