diff --git a/.github/workflows/cherryPick.yml b/.github/workflows/cherryPick.yml index 10b85a223fc0..d4c3d9b41d0e 100644 --- a/.github/workflows/cherryPick.yml +++ b/.github/workflows/cherryPick.yml @@ -15,6 +15,9 @@ jobs: cherryPick: needs: createNewVersion runs-on: ubuntu-latest + env: + # The name of the branch created if there are conflicts when CPing the PR. + CONFLICT_BRANCH_NAME: cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_id }}-${{ github.run_attempt }} steps: - name: Checkout staging branch # v4 @@ -124,8 +127,8 @@ jobs: - name: Push changes run: | if [[ ${{steps.cherryPick.outputs.HAS_CONFLICTS}} == 'true' ]]; then - git checkout -b ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }} - git push --set-upstream origin ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }} + git checkout -b ${{ env.CONFLICT_BRANCH_NAME }} + git push --set-upstream origin ${{ env.CONFLICT_BRANCH_NAME }} else git push origin staging fi @@ -143,7 +146,7 @@ jobs: \`\`\`bash git fetch - git checkout ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }} + git checkout ${{ env.CONFLICT_BRANCH_NAME }} git cherry-pick -S -x --mainline 1 ${{ steps.getCPMergeCommit.outputs.MERGE_COMMIT_SHA }} \`\`\` @@ -153,7 +156,7 @@ jobs: git commit --amend -m "\$(git log -1 --pretty=%B)" -m "(CP triggered by ${{ github.actor }})" \`\`\` - That will help us keep track of who triggered this CP. Once all that's done, push your changes with \`git push origin ${{ github.actor }}-cherry-pick-staging-${{ github.event.inputs.PULL_REQUEST_NUMBER }}-${{ github.run_attempt }}\`, and then open this PR for review. + That will help us keep track of who triggered this CP. Once all that's done, push your changes with \`git push origin ${{ env.CONFLICT_BRANCH_NAME }}\`, and then open this PR for review. Note that you **must** test this PR, and both the author and reviewer checklist should be completed, just as if you were merging the PR to main.