From 0c8c0f6f78c0f9b949c07626e5e16e49aebcbbf0 Mon Sep 17 00:00:00 2001 From: Josh Flayhart Date: Tue, 9 Jun 2026 23:00:25 -0500 Subject: [PATCH] fix(ci): parse release PR number in shell, not fromJSON in env MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fromJSON(steps.release.outputs.pr) in the step env crashes the entire Release Please workflow with a template error on runs where release-please cuts the release: there is no open PR, the pr output is empty, and fromJSON('') fails — even though the step's if-guard would skip the step. Pass the raw output through env and parse the number with jq inside run, which only executes when the if-guard passes. --- .github/workflows/release-please.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index aea92a7..a2b16de 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -29,5 +29,9 @@ jobs: if: ${{ steps.release.outputs.pr }} env: GH_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }} - PR_NUMBER: ${{ fromJSON(steps.release.outputs.pr).number }} - run: gh pr merge "$PR_NUMBER" --squash + # Pass the raw output through and parse it in the shell. Do NOT call + # fromJSON() here: on runs where release-please cuts the release there + # is no open PR, `pr` is empty, and fromJSON('') fails the whole + # workflow with a template error even though `if` skips the step. + RELEASE_PR: ${{ steps.release.outputs.pr }} + run: gh pr merge "$(jq -r '.number' <<< "$RELEASE_PR")" --squash