-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[6.12.z] added support to auto-merge the auto-cherry-pick pr (#10432)
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
1 parent
f87d479
commit e724938
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} !" |