Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.12.z] Bump pascalgn/automerge-action from 0.15.6 to 0.16.2 #1184

Merged
merged 3 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/auto_cherry_pick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: auto_cherry_pick_commits

on:
pull_request_target:
types:
- closed
types: [closed]

# Github & Parent PR Env vars
env:
Expand All @@ -27,6 +26,7 @@ jobs:
with:
issue-number: ${{ env.number }}
body-includes: "trigger: test-robottelo"
direction: last

# Auto CherryPicking and Failure Recording
auto-cherry-pick:
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
## Failure Logging to issues and GChat Group
- name: Create Github issue on cherrypick failure
id: create-issue
if: ${{ always() && steps.cherrypick.outcome == 'failure' }}
if: ${{ always() && steps.cherrypick.outcome != 'success' && startsWith(matrix.label, '6.') && matrix.label != github.base_ref }}
uses: dacbd/create-issue-action@main
with:
token: ${{ secrets.CHERRYPICK_PAT }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ on:
- ready_for_review
branches-ignore:
- master
pull_request_review:
types:
- submitted
branches-ignore:
- master
check_suite:
types:
- completed
Expand Down Expand Up @@ -45,73 +40,40 @@ jobs:

- name: Wait for other status checks to Pass
id: waitforstatuschecks
uses: lewagon/wait-on-check-action@v1.2.0
uses: lewagon/wait-on-check-action@v1.3.3
with:
ref: ${{ github.head_ref }}
repo-token: ${{ secrets.CHERRYPICK_PAT }}
wait-interval: 60
running-workflow-name: 'Automerge auto-cherry-picked pr'
allowed-conclusions: success,skipped

- name: is PRT check Passed ?
run: |
api_endpoint="https://api.github.com/repos/${{github.repository}}/statuses/${{ github.head_ref }}"

function get_status() {
curl -s "$api_endpoint" | jq '[.[] | .state] | .[0]'
}

function get_context() {
curl -s "$api_endpoint" | jq '[.[] | .context] | .[0]'
}

statuses_length=$(curl -s $api_endpoint | jq 'length')
if [ $statuses_length -eq 0 ]; then
echo "PRT failed to start ! Stopping."
exit 1
fi

status=$(get_status)
context=$(get_context)

if [ "$context" != "Robottelo-Runner" ]; then
echo "::error Failed to get Robottelo-Runner status"
exit 1
fi

counter=0
echo "Waiting for PRT to complete....."
while [ "$status" != "success" ] && [ "$status" != "failure" ]; do
if [ $counter -gt 20 ]; then
echo "PRT Timeout"
exit 1
fi
sleep 300
status=$(get_status)
echo "Robottelo-Runner : $status"
counter=$((counter+1))
done
- name: Fetch the PRT status
id: outcome
uses: omkarkhatavkar/wait-for-status-checks@main
with:
ref: ${{ github.head_ref }}
context: 'Robottelo-Runner'
wait-interval: 60
count: 100

if [ "$status" == "success" ]; then
echo "PRT Passed Successfully!"
- name: Check the PRT status
run: |
if [ ${{ steps.outcome.outputs.result }} == 'success' ]; then
echo "Status check passed!"
else
echo "Robottelo-Runner : $status"
echo "::error PRT failed"
exit 1
echo "Status check failed!"
fi


- id: automerge
name: Auto merge of cherry-picked PRs.
uses: "pascalgn/[email protected]"
if: steps.waitforstatuschecks.outputs.status == 'success'
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
BASE_BRANCHES: "master" # avoid automerge branch

- name: Auto Merge Status
run: |
Expand Down