From 0a88cfef82b2b70b4000289b40924b4548f7777a Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Thu, 18 Jul 2024 16:14:21 +0200 Subject: [PATCH] ci: use auto-merge wrapper --- .github/workflows/auto-merge-on-demand.yml | 30 +++------------------- .github/workflows/auto-merge.yml | 26 +++---------------- 2 files changed, 7 insertions(+), 49 deletions(-) diff --git a/.github/workflows/auto-merge-on-demand.yml b/.github/workflows/auto-merge-on-demand.yml index 3e46c227..47003fdd 100644 --- a/.github/workflows/auto-merge-on-demand.yml +++ b/.github/workflows/auto-merge-on-demand.yml @@ -1,4 +1,4 @@ -name: Auto Merge On Demand +name: Auto Merge Scheduled / On Demand on: schedule: # Workflow runs every 45 minutes @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 13c4d838..f5a580e9 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -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 }}