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.17.z] Update dependancy-merge workflow as for other z-stream branches #17654

Merged
Merged
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
50 changes: 17 additions & 33 deletions .github/workflows/dependency_merge.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,30 @@
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]'
if: contains(github.event.pull_request.labels.*.name, 'dependencies')
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Checkout
uses: actions/checkout@v4
- id: find-prt-comment
name: Find the prt comment
uses: peter-evans/find-comment@v2
with:
fetch-depth: 0
issue-number: ${{ github.event.number }}
body-includes: "trigger: test-robottelo"
direction: last

- name: Find the tests for the dependency requirement
id: yaml
uses: mikefarah/yq@master
with:
cmd: yq eval '.["${{ steps.metadata.outputs.dependency-names }}"|split("[")[0]]' ./.github/dependency_tests.yaml

- name: Add the PRT Comment
if: steps.yaml.outputs.result != 'null'
uses: peter-evans/create-or-update-comment@v4
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 @@ -54,7 +38,7 @@ jobs:
uses: lewagon/[email protected]
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 +47,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