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

ci: use auto-merge wrapper #311

Merged
merged 1 commit into from
Jul 19, 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
30 changes: 3 additions & 27 deletions .github/workflows/auto-merge-on-demand.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Auto Merge On Demand
name: Auto Merge Scheduled / On Demand
on:
schedule:
# Workflow runs every 45 minutes
Expand Down Expand Up @@ -64,32 +64,8 @@ jobs:
pull-requests: write

steps:
- id: metadata
name: Gather Pull Request Metadata
uses: redhat-plumbers-in-action/gather-pull-request-metadata@v1
- name: Auto Merge wrapper
uses: sclorg/auto-merge-wrapper@v1
with:
pr-number: ${{ matrix.pr-number }}

- id: pull-request-validator
name: Pull Request Validator
uses: redhat-plumbers-in-action/pull-request-validator@v2
with:
pr-metadata: ${{ steps.metadata.outputs.metadata }}
token: ${{ secrets.GITHUB_TOKEN }}

- id: auto-merge
name: Auto Merge
uses: redhat-plumbers-in-action/auto-merge@v2
with:
pr-metadata: ${{ steps.metadata.outputs.metadata }}
token: ${{ secrets.GITHUB_TOKEN }}

- if: ${{ !cancelled() }}
name: Show results in PR comment
uses: redhat-plumbers-in-action/issue-commentator@v1
with:
issue: ${{ fromJSON(steps.metadata.outputs.metadata).number }}
message: |
${{ steps.pull-request-validator.outputs.status && steps.pull-request-validator.outputs.status || '' }}
${{ steps.auto-merge.outputs.status && steps.auto-merge.outputs.status || '' }}
token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 4 additions & 22 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,14 @@ jobs:
runs-on: ubuntu-latest

permissions:
# required for ability to merge Pull Request
# required for merging PRs
contents: write
# required for setting labels
# required for PR comments and setting labels
pull-requests: write

steps:
- id: pull-request-validator
name: Pull Request Validator
uses: redhat-plumbers-in-action/pull-request-validator@v2
- name: Auto Merge wrapper
uses: sclorg/auto-merge-wrapper@v1
with:
pr-metadata: ${{ needs.download-metadata.outputs.pr-metadata }}
token: ${{ secrets.GITHUB_TOKEN }}

- id: auto-merge
name: Auto Merge
uses: redhat-plumbers-in-action/auto-merge@v2
with:
pr-metadata: ${{ needs.download-metadata.outputs.pr-metadata }}
token: ${{ secrets.GITHUB_TOKEN }}

- if: ${{ !cancelled() }}
name: Show results in PR comment
uses: redhat-plumbers-in-action/issue-commentator@v1
with:
issue: ${{ fromJSON(needs.download-metadata.outputs.pr-metadata).number }}
message: |
${{ steps.pull-request-validator.outputs.status && steps.pull-request-validator.outputs.status || '' }}
${{ steps.auto-merge.outputs.status && steps.auto-merge.outputs.status || '' }}
token: ${{ secrets.GITHUB_TOKEN }}