Skip to content

Commit

Permalink
making same as other z-stream branches
Browse files Browse the repository at this point in the history
  • Loading branch information
omkarkhatavkar committed Jan 31, 2024
1 parent 7a5e132 commit 3f0a4e9
Showing 1 changed file with 20 additions and 34 deletions.
54 changes: 20 additions & 34 deletions .github/workflows/dependency_merge.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,32 @@
name: Dependabot Auto Merge
on: pull_request

permissions:
pull-requests: write
name: Dependabot Auto Merge - ZStream
on:
pull_request_target:
branches-ignore:
- master

jobs:
dependabot:
name: dependabot-auto-merge
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]'
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
if: |
contains(github.event.pull_request.labels.*.name, 'dependencies')
- name: Find the tests for the dependency requirement
id: yaml
uses: mikefarah/yq@master
steps:
- id: find-prt-comment
name: Find the prt comment
uses: peter-evans/find-comment@v2
with:
cmd: yq e '.["${{ steps.metadata.outputs.dependency-names }}"]' ./.github/dependency_tests.yaml
issue-number: ${{ github.event.number }}
body-includes: "trigger: test-robottelo"
direction: last

- name: Add the PRT Comment
if: steps.yaml.outputs.result != 'null'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
trigger: test-robottelo\r
pytest: ${{ steps.yaml.outputs.result }}
- name: Wait for PRT checks to get initiated
if: steps.yaml.outputs.result != 'null'
if: steps.find-prt-comment.outputs.comment-body != ''
run: |
echo "Waiting for ~ 10 mins, PRT to be initiated." && sleep 600
- name: Fetch and Verify the PRT status
if: steps.yaml.outputs.result != 'null'
if: steps.find-prt-comment.outputs.comment-body != ''
id: outcome
uses: omkarkhatavkar/wait-for-status-checks@main
with:
Expand All @@ -51,10 +37,10 @@ jobs:

- name: Wait for other status checks to Pass
id: waitforstatuschecks
uses: lewagon/[email protected].3
uses: lewagon/[email protected].1
with:
ref: ${{ github.head_ref }}
repo-token: ${{ secrets.CHERRYPICK_PAT }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 60
running-workflow-name: 'dependabot-auto-merge'
allowed-conclusions: success,skipped
Expand All @@ -63,7 +49,7 @@ jobs:
name: Auto merge of dependabot PRs.
uses: "pascalgn/[email protected]"
env:
GITHUB_TOKEN: "${{ secrets.CHERRYPICK_PAT }}"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_LABELS: "dependencies"
MERGE_METHOD: "squash"
MERGE_RETRIES: 5
Expand Down

0 comments on commit 3f0a4e9

Please sign in to comment.