From 48bd82efd74a729e487c66ba638ead1036b6771c Mon Sep 17 00:00:00 2001 From: Vicary Date: Sat, 20 Nov 2021 14:45:25 +0800 Subject: [PATCH 1/2] dependabot-automerge --- .github/workflows/dependabot-automerge.yml | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/dependabot-automerge.yml diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml new file mode 100644 index 000000000..76eb42899 --- /dev/null +++ b/.github/workflows/dependabot-automerge.yml @@ -0,0 +1,32 @@ +name: Auto-merge Dependabot minors + +on: + pull_request_target: + workflow_run: + workflows: + - Tests + types: + - completed + +permissions: + pull-requests: write + contents: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' && github.event.workflow_run.conclusion == 'success' }} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1.1.1 + with: + github-token: '${{ secrets.GITHUB_TOKEN }}' + - name: Approve and merge minor updates + if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch' }} + run: | + gh pr review --approve "$PR_URL" + gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 4dc51ba67cb413cff922e521468dac6efbb0e7d9 Mon Sep 17 00:00:00 2001 From: Vicary Date: Tue, 23 Nov 2021 13:37:04 +0800 Subject: [PATCH 2/2] remove workflow dependency --- .github/workflows/dependabot-automerge.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index 76eb42899..2ef6d8d7d 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -1,12 +1,5 @@ name: Auto-merge Dependabot minors - -on: - pull_request_target: - workflow_run: - workflows: - - Tests - types: - - completed +on: pull_request_target permissions: pull-requests: write @@ -15,7 +8,7 @@ permissions: jobs: dependabot: runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' && github.event.workflow_run.conclusion == 'success' }} + if: ${{ github.actor == 'dependabot[bot]' }} steps: - name: Dependabot metadata id: metadata