From 0763dd65792cbc92c7adb461dfd1a38844556555 Mon Sep 17 00:00:00 2001 From: witold Date: Mon, 5 Dec 2022 11:24:41 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Fix=20automerge=20dependabot=20P?= =?UTF-8?q?Rs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/automerge-dependabot.yaml | 58 ++++++--------------- .prettierignore | 1 + 2 files changed, 18 insertions(+), 41 deletions(-) diff --git a/.github/workflows/automerge-dependabot.yaml b/.github/workflows/automerge-dependabot.yaml index dce037de7..f3b2d3978 100644 --- a/.github/workflows/automerge-dependabot.yaml +++ b/.github/workflows/automerge-dependabot.yaml @@ -1,47 +1,23 @@ -name: Merge me! +name: Dependabot auto-merge +on: pull_request -on: - workflow_run: - types: [completed] - workflows: ["Test"] - branches: - # npm - - "dependabot/*eslint*" - - "dependabot/*jest-and-types*" - - "dependabot/*prettier*" - - "dependabot/*css-loader*" - - "dependabot/*webpack*" - - "dependabot/*purgecss-webpack-plugin*" - - "dependabot/*mini-css-extract-plugin*" - # pip - - "dependabot/*pylint*" - - "dependabot/*black*" - - "dependabot/*flake8*" - - "dependabot/*ipython*" - - "dependabot/*isort*" - - "dependabot/*pytest*" - - "dependabot/*sentry-sdk*" +permissions: + contents: write + pull-requests: write jobs: - merge-me: - name: Merge me! + dependabot: runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} steps: - - # It is often a desired behavior to merge only when a workflow execution - # succeeds. This can be changed as needed. - if: ${{ github.event.workflow_run.conclusion == 'success' }} - name: Merge me! - uses: ridedott/merge-me-action@v2 + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v1.1.1 with: - # Depending on branch protection rules, a manually populated - # `GITHUB_TOKEN_WORKAROUND` secret with permissions to push to - # a protected branch must be used. This secret can have an arbitrary - # name, as an example, this repository uses `DOTTBOTT_TOKEN`. - # - # When using a custom token, it is recommended to leave the following - # comment for other developers to be aware of the reasoning behind it: - # - # This must be used as GitHub Actions token does not support pushing - # to protected branches. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PRESET: DEPENDABOT_MINOR + github-token: "${{ secrets.GITHUB_TOKEN }}" + - name: Enable auto-merge for Dependabot PRs + if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'}} + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.prettierignore b/.prettierignore index 5c7082b75..3c0b594f6 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ _static/** **/assets/dist/** +.github/workflows/automerge-dependabot.yaml \ No newline at end of file