File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,10 +131,19 @@ jobs:
131131 fi
132132
133133 if [[ "$DRY_RUN" == "false" ]]; then
134- git -C "$repo_dir" remote add upstream "https://github.com/${UPSTREAM_REPO}.git"
135- git -C "$repo_dir" fetch --depth=1 upstream master
134+ if git -C "$repo_dir" remote get-url upstream >/dev/null 2>&1; then
135+ git -C "$repo_dir" remote set-url upstream "https://github.com/${UPSTREAM_REPO}.git"
136+ else
137+ git -C "$repo_dir" remote add upstream "https://github.com/${UPSTREAM_REPO}.git"
138+ fi
139+ if git -C "$repo_dir" ls-remote --exit-code --heads upstream main >/dev/null 2>&1; then
140+ upstream_ref="main"
141+ else
142+ upstream_ref="master"
143+ fi
144+ git -C "$repo_dir" fetch --depth=1 upstream "$upstream_ref"
136145 branch_name="zeroclaw-${RELEASE_TAG}-${GITHUB_RUN_ID}"
137- git -C "$repo_dir" checkout -B "$branch_name" upstream/master
146+ git -C "$repo_dir" checkout -B "$branch_name" " upstream/$upstream_ref"
138147 echo "branch_name=$branch_name" >> "$GITHUB_OUTPUT"
139148 fi
140149
@@ -196,7 +205,7 @@ jobs:
196205
197206 gh pr create \
198207 --repo "$UPSTREAM_REPO" \
199- --base master \
208+ --base main \
200209 --head "${fork_owner}:${branch_name}" \
201210 --title "$pr_title" \
202211 --body "$pr_body"
You can’t perform that action at this time.
0 commit comments