Skip to content

Commit

Permalink
ci: use auto-merge wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Jul 19, 2024
1 parent 273888d commit 0a88cfe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 49 deletions.
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 }}

0 comments on commit 0a88cfe

Please sign in to comment.