We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82bc489 commit b29bf3fCopy full SHA for b29bf3f
1 file changed
.github/workflows/backport.yml
@@ -135,7 +135,13 @@ jobs:
135
env:
136
STEPS_BACKPORT_BRANCH_OUTPUTS_NAME: ${{ steps.backport-branch.outputs.name }}
137
MATRIX_BRANCH: ${{ matrix.branch }}
138
- run: git checkout -b "${STEPS_BACKPORT_BRANCH_OUTPUTS_NAME}" "origin/${MATRIX_BRANCH}"
+ run: |
139
+ if git ls-remote --exit-code --heads origin "${STEPS_BACKPORT_BRANCH_OUTPUTS_NAME}" > /dev/null 2>&1; then
140
+ echo "::error::Branch '${STEPS_BACKPORT_BRANCH_OUTPUTS_NAME}' already exists on origin."
141
+ exit 1
142
+ fi
143
+
144
+ git checkout -b "${STEPS_BACKPORT_BRANCH_OUTPUTS_NAME}" "origin/${MATRIX_BRANCH}"
145
146
- name: Cherry-pick commit
147
if: ${{ inputs['commit-sha'] != '' }}
0 commit comments