From 620ea963ba654fb7fc3cd249a611a68a96634737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bj=C3=B6rkert?= Date: Sun, 21 Jun 2026 17:48:48 +0200 Subject: [PATCH] release.sh: set gh pr repo explicitly Derive owner/repo from the origin remote and pass --repo to both gh pr create calls so the release flow does not depend on gh's inferred default repo, which fails in clones with multiple remotes. --- release.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/release.sh b/release.sh index 3ba67c2fb..fd4bc9b4f 100755 --- a/release.sh +++ b/release.sh @@ -137,8 +137,15 @@ if [[ $confirm =~ ^[Yy]$ ]]; then for cmd in "${push_cmds[@]}"; do echo "+ $cmd"; bash -c "$cmd"; done echo "🎉 All pushes completed." + # --- resolve the GitHub repo explicitly so gh doesn't depend on a default ---- + # Clones with multiple remotes have no inferred default repo, which makes + # `gh pr create` fail. Derive owner/repo from the origin remote URL. + # Handles both https://github.com/owner/repo(.git) and git@github.com:owner/repo(.git) + REPO_SLUG="$(git remote get-url origin | sed -E -e 's#\.git$##' -e 's#^.*github\.com[:/]##')" + echo; echo "📝 Opening sync PR ${RELEASE_BRANCH} → ${DEV_BRANCH} …" gh pr create \ + --repo "$REPO_SLUG" \ --base "$DEV_BRANCH" \ --head "$RELEASE_BRANCH" \ --title "Sync v${new_ver} version bump to dev" \ @@ -150,6 +157,7 @@ if [[ $confirm =~ ^[Yy]$ ]]; then echo; echo "📝 Opening release PR ${RELEASE_BRANCH} → ${MAIN_BRANCH} …" gh pr create \ + --repo "$REPO_SLUG" \ --base "$MAIN_BRANCH" \ --head "$RELEASE_BRANCH" \ --title "Release v${new_ver}" \