Skip to content

fix(release): skip HAR sync when release-plz creates no PR - #117

Merged
richerfu merged 1 commit into
mainfrom
fix/release-sync-skip-empty-pr
Oct 29, 2026
Merged

richerfu merged 1 commit into
mainfrom
fix/release-sync-skip-empty-pr

Conversation

@richerfu

Copy link
Copy Markdown
Contributor

Problem

After #116 merged, the Release-plz PR job still failed, now in Sync OHPM HAR versions and changelogs to release PR:

release_pr_output: {"prs":[]}
env:
  PR_JSON: {}
...
fatal: couldn't find remote ref undefined

#116 only touched lockfiles, scripts and docs, so release-plz had no crate to release and created no release PR. release-plz-action@v0.5 reports its pr output as {} in that case, but the step only guarded against an empty string. The script parsed {}, pr.head_branch was undefined, and git fetch origin undefined failed.

Changes

Treat a missing head_branch as "nothing to sync": print a message and exit successfully before any git operation. Real release PRs are unchanged.

Verification

Extracted branch-name logic tested locally:

PR_JSON={}                                -> ""   (skip)
PR_JSON=                                 -> ""   (skip)
PR_JSON={"head_branch":"release-plz-…"}  -> "release-plz-…" (sync)

🤖 Generated with Claude Code

release-plz-action reports `{}` for its `pr` output when no release PR is
created (for example, a push that touches no crate). The sync step only
checked for an empty string, so it parsed `{}`, derived an undefined
branch name, and failed with "couldn't find remote ref undefined".

Treat a missing `head_branch` as "nothing to sync" and exit successfully.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@richerfu
richerfu merged commit 7c91dfa into main Oct 29, 2026
1 check passed
@richerfu
richerfu deleted the fix/release-sync-skip-empty-pr branch October 29, 2026 07:01
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