From 95bd6e97f1531b457858849dab9a127aeab4d7bc Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 1 Oct 2026 06:37:47 +0000 Subject: [PATCH] fix(ci): stop the release merge step failing when nothing is released The merge step's env ran fromJSON on release-please's pr output, which is empty when a push has nothing to release. That failed the whole job on every docs, ci or chore push to main, even though the step itself was skipped. Pass the raw output through and read the PR number with jq. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CeBtzKd8cVXMuR6go3Ba6n --- .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 649eedf..875b455 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -32,10 +32,14 @@ jobs: # to release, as for docs or ci commits. - name: Merge the release PR if: ${{ steps.release.outputs.pr }} + # Step env is evaluated even when `if` skips the step, so fromJSON on an + # empty `pr` would fail the job. Parse the PR in the shell instead. env: GH_TOKEN: ${{ github.token }} - PR_NUMBER: ${{ fromJSON(steps.release.outputs.pr).number }} - run: gh pr merge "$PR_NUMBER" --squash --repo "$GITHUB_REPOSITORY" + RELEASE_PR: ${{ steps.release.outputs.pr }} + run: | + pr_number="$(jq -r '.number' <<<"$RELEASE_PR")" + gh pr merge "$pr_number" --squash --repo "$GITHUB_REPOSITORY" # A merge made with GITHUB_TOKEN does not trigger this workflow again, so # run release-please once more to tag and publish what was just merged.