fix(ci): defer fromJson(release.outputs.pr) into a run block#51
Merged
StefanSteiner merged 1 commit intoMay 27, 2026
Merged
Conversation
The follow-up steps added in PR tableau#50 reference `fromJson(steps.release.outputs.pr).headBranchName` directly in `ref:` (checkout) and `env:` (push) blocks. GitHub Actions evaluates every `${{ }}` expression in the workflow at job-load time, BEFORE per-step `if:` gates short-circuit. When release-please runs on a push that doesn't produce a release PR (e.g. a PR merge whose conventional- commit was already covered by an earlier release), `pr` is the empty string, `fromJson('')` errors out, and the entire job fails with: ##[error]The template is not valid. .../release-please.yml (Line: 203, Col: 19): Error reading JToken from JsonReader. Path '', line 0, position 0. This blocks release-please from ever opening the next release PR. Observed in run 26494686197 on the merge of PR tableau#50 itself. Fix: extract the branch name in a new "Resolve release-please branch name" step (id=`branch`) that does the parse via `jq` inside a `run:` block — that block only runs when the step's `if:` gate passes, so the parse is never attempted on empty input. The downstream `actions/checkout` `ref:` and the final `git push` `env: BRANCH:` both reference `steps.branch.outputs.name`, which evaluates safely to the empty string when the step was skipped. Add a doc comment explaining the GHA expression-evaluation timing trap so the next person reading the workflow doesn't accidentally re-introduce the same pattern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to PR #50. The release-please workflow added in #50 references
fromJson(steps.release.outputs.pr).headBranchNamedirectly in two YAML expression slots:GitHub Actions evaluates every
${{ }}expression in the workflow at job-load time, BEFORE per-stepif:gates short-circuit. When release-please runs on a push that doesn't produce a release PR (proutput is the empty string),fromJson('')errors with:This blocks release-please from opening the next release PR. Observed in run 26494686197 on the merge of PR #50 itself.
Fix
Extract the branch name in a new
Resolve release-please branch namestep (id=branch) that does the parse viajqinside arun:block. That block only runs when the step'sif:gate passes, so the parse is never attempted on empty input. The downstreamactions/checkoutref:and the finalgit pushenv: BRANCH:both referencesteps.branch.outputs.name, which evaluates safely to the empty string when the resolver step was skipped.Also adds a doc comment explaining the GHA expression-evaluation timing trap so the next person reading the workflow doesn't re-introduce the same pattern.
Why this didn't surface in PR #50's review
The expression-evaluation timing was correctly identified during local development and the fix landed in the working tree. It then failed to ride the squash-merge — the amended commit was force-pushed to the fork after PR #50 was opened, and the merge picked up the earlier head. A timing/ordering mistake on my side; the workflow change in #50 was incomplete.
Test plan
ruby -ryaml).fix(ci): ...push completes successfully (no JsonReader error).outputPRs; the next push to main re-runs release-please which then opens the PR).chore: sync Cargo.lock with bumped workspace versionscommit on top of release-please's bot commit.0.2.2.r<hash>with no-dirty-...suffix.