Skip to content

Commit

Permalink
Have cherry pick workflow handle conflicts (#259) (#269)
Browse files Browse the repository at this point in the history
b/279224773

(cherry picked from commit dad1b8d)

Co-authored-by: andrewsavage1 <andrewsavage@google.com>
  • Loading branch information
1 parent 4849456 commit eff5367
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/label-cherry-pick.yaml
Expand Up @@ -72,12 +72,23 @@ jobs:
- name: Cherry pick merge commit
run: |
git fetch origin ${{ matrix.target_branch }}
set +e
git cherry-pick -x $MERGE_COMMIT_SHA
RES=$?
set -e
if [ $RES -eq 0 ]; then
echo "CREATE_PR_AS_DRAFT=false" >> $GITHUB_ENV
else
echo "CREATE_PR_AS_DRAFT=true" >> $GITHUB_ENV
git add .
git cherry-pick --continue
fi
- name: Create Pull Request
uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3
with:
token: ${{ secrets.CHERRY_PICK_TOKEN }}
draft: ${{ env.CREATE_PR_AS_DRAFT }}
base: ${{ matrix.target_branch }}
branch: "${{ matrix.target_branch }}-${{ github.event.pull_request.number }}"
committer: GitHub Release Automation <github@google.com>
Expand Down

0 comments on commit eff5367

Please sign in to comment.