Skip to content

fix(ci): parse release PR number in shell, not fromJSON in env#26

Merged
jflayhart merged 1 commit into
mainfrom
hotfix/release-merge-fromjson
Jun 10, 2026
Merged

fix(ci): parse release PR number in shell, not fromJSON in env#26
jflayhart merged 1 commit into
mainfrom
hotfix/release-merge-fromjson

Conversation

@jflayhart

Copy link
Copy Markdown
Contributor

Problem

My earlier auto-merge change put fromJSON(steps.release.outputs.pr).number in the step env:. On runs where release-please cuts the release (no open release PR), steps.release.outputs.pr is empty, so fromJSON('') throws a template error that fails the whole Release Please workflow — even though the step's if guard would otherwise skip it:

Error: The template is not valid. .github/workflows/release-please.yml (Line: 33, Col: 22):
Error reading JToken from JsonReader. Path '', line 0, position 0.

Fix

Pass the raw pr output through env (a plain string, safe when empty) and parse .number with jq inside run, which only executes when the if guard passes.

Note

Merging this unbreaks the workflow and lets release-please auto-merge any open release PR → tag → publish. Merge when you're ready to cut the pending release.

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.
@jflayhart
jflayhart merged commit a364403 into main Jun 10, 2026
5 checks passed
@jflayhart
jflayhart deleted the hotfix/release-merge-fromjson branch June 10, 2026 04:03
This was referenced Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant