Skip to content

Commit

Permalink
[6.12.z] added support to auto-merge the auto-cherry-pick pr (#10432)
Browse files Browse the repository at this point in the history
added support to auto-merge the auto-cherry-pick pr (#10372)

added support to automerge the autocherry pick pr

(cherry picked from commit d7078f2)

Co-authored-by: Omkar Khatavkar <[email protected]>
  • Loading branch information
Satellite-QE and omkarkhatavkar authored Dec 19, 2022
1 parent f87d479 commit e724938
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/automerge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: automerge auto-cherry-picked pr's
on:
pull_request_target:
types:
- labeled
- unlabeled
- edited
- ready_for_review
branches-ignore:
- master
issue_comment:
types:
- created
- deleted
pull_request_review:
types:
- submitted
check_suite:
types:
- completed

jobs:
automerge:
name: Automerge auto-cherry-picked pr
if: contains(github.event.pull_request.labels.*.name, 'AutoMerge_Cherry_Picked')
runs-on: ubuntu-latest
steps:
- id: find-prt-comment
name: Find the prt comment
uses: peter-evans/find-comment@v2
with:
issue-number: ${{ github.event.number }}
body-includes: "trigger: test-robottelo"
direction: last

- name: Fail automerge if PRT was not initiated
if: steps.find-prt-comment.outputs.comment-body == ""
run: |
echo "::error PRT comment not added the PR"
- name: Wait for PRT checks to get initiated
run: |
if [ "${{ github.event_name }}" == "issue_comment" ]; then
echo "Waiting for 5 min, PRT to be initiated." && sleep 300
fi
- id: automerge
name: Auto merge of cherry-picked PRs.
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.CHERRYPICK_PAT }}"
MERGE_LABELS: "AutoMerge_Cherry_Picked, Auto_Cherry_Picked"
MERGE_METHOD: "squash"
MERGE_RETRIES: 5
MERGE_RETRY_SLEEP: 900000

- name: Auto Merge Status
run: |
if [ "${{ steps.automerge.outputs.mergeResult }}" == 'merged' ]; then
echo "Pull request ${{ steps.automerge.outputs.pullRequestNumber }} is Auto Merged !"
else
echo "::error Auto Merge of Pull request ${{ steps.automerge.outputs.pullRequestNumber }} is ${{steps.automerge.outputs.mergeResult}} !"

0 comments on commit e724938

Please sign in to comment.