Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/cut-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ jobs:
git config user.name "$slug"
git config user.email "${id}+${slug}@users.noreply.github.com"

# release.sh resolves the default branch from origin/HEAD, which
# 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.


- name: Prepare release
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
Expand Down Expand Up @@ -125,6 +131,12 @@ jobs:
git config user.name "$slug"
git config user.email "${id}+${slug}@users.noreply.github.com"

# release.sh resolves the default branch from origin/HEAD, which
# 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

- name: Tag and push
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
Expand Down
Loading