We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84d60c0 commit 85aeea3Copy full SHA for 85aeea3
1 file changed
.github/workflows/stable-sync.yml
@@ -54,8 +54,15 @@ jobs:
54
CREATE_BRANCH: 'false'
55
run: |
56
node .github/scripts/stable-sync.js "stable-main-${{ inputs.semver-version }}"
57
- # Push the branch to origin using GitHub CLI
58
- git push --set-upstream origin "stable-main-${{ inputs.semver-version }}"
+ # Check if branch exists remotely
+ BRANCH_NAME="stable-main-${{ inputs.semver-version }}"
59
+ if git ls-remote --heads origin "$BRANCH_NAME" | grep -q "$BRANCH_NAME"; then
60
+ echo "Branch $BRANCH_NAME exists remotely, pushing normally"
61
+ git push origin "$BRANCH_NAME"
62
+ else
63
+ echo "Branch $BRANCH_NAME doesn't exist remotely, pushing with --set-upstream"
64
+ git push --set-upstream origin "$BRANCH_NAME"
65
+ fi
66
67
- name: Create Pull Request
68
if: steps.check-pr.outputs.result != 'true'
0 commit comments