From 2b66ea916bb108806387f52bf85c22044537a7cc Mon Sep 17 00:00:00 2001 From: William Brawner Date: Wed, 27 Mar 2024 16:51:29 -0600 Subject: [PATCH] Split auto-merge into separate workflow --- .github/workflows/auto-merge.yml | 18 ++++++++++++++++++ .github/workflows/pull-request.yml | 15 --------------- 2 files changed, 18 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/auto-merge.yml diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml new file mode 100644 index 0000000..b2ab7c1 --- /dev/null +++ b/.github/workflows/auto-merge.yml @@ -0,0 +1,18 @@ +name: Enable Auto Merge +on: pull_request + +permissions: + contents: write + pull-requests: write + +jobs: + auto-merge: + runs-on: ubuntu-latest + if: ${{ github.actor == 'wbrawner' || github.actor == 'dependabot[bot]' }} + steps: + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --rebase "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{secrets.GH_TOKEN}} + diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 64ffbcb..8ba66cf 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,11 +1,6 @@ name: Pull request workflow on: pull_request -permissions: - contents: write - pull-requests: write - checks: write - jobs: test: name: Build and Test @@ -30,13 +25,3 @@ jobs: path: "*/build/test-results/test/*.xml" reporter: java-junit fail-on-error: true - automerge: - name: Enable automerge - runs-on: ubuntu-latest - if: ${{ github.actor == 'wbrawner' || github.actor == 'dependabot[bot]' }} - steps: - - name: Enable auto-merge - run: gh pr merge --auto --rebase "$PR_URL" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GH_TOKEN}}