Skip to content

ci: set origin/HEAD before running release.sh - #218

Merged
eddietejeda merged 1 commit into
mainfrom
ci/release-origin-head
Oct 15, 2026
Merged

eddietejeda merged 1 commit into
mainfrom
ci/release-origin-head

Conversation

@eddietejeda

Copy link
Copy Markdown
Contributor

The first Cut Release run (38795364225) failed in release.sh prepare with fatal: empty string is not a valid pathspec. The script resolves the base branch from origin/HEAD, which actions/checkout never sets. Both jobs now run git remote set-head origin --auto before calling the script. No script change.

actions/checkout does not create refs/remotes/origin/HEAD, so
release.sh's default_branch() resolved to an empty string and the first
Cut Release run failed on an empty pathspec.
@eddietejeda
eddietejeda requested a review from a team as a code owner October 15, 2026 19:38
@eddietejeda
eddietejeda requested review from anoop-narang and removed request for a team October 15, 2026 19:38
@eddietejeda
eddietejeda enabled auto-merge (squash) October 15, 2026 19:38
# actions/checkout never sets; without this the script sees an empty
# branch name and git aborts on an empty pathspec.
- name: Point origin/HEAD at the default branch
run: git remote set-head origin --auto

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Fix the fallback in default_branch() at scripts/release.sh:123-128 too (not blocking). The current fallback cannot recover from a missing origin/HEAD, so any other clone without origin/HEAD fails the same way.

The fallback has two defects:

  • The sed expression uses | as its delimiter. Inside the pattern, \| therefore matches a literal |, not alternation. The origin/main line never matches.
  • Under set -o pipefail, the git branch -r | sed | head pipeline exits 0 with empty output. The || echo main branch never runs.

One fix: use # as the sed delimiter. Also replace the || chain with an explicit [[ -n "$b" ]] check before the echo main default.

@eddietejeda
eddietejeda merged commit 84cf4b9 into main Oct 15, 2026
4 checks passed
@eddietejeda
eddietejeda deleted the ci/release-origin-head branch October 15, 2026 19:40
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