Skip to content

Commit

Permalink
💚 Fix automerge dependabot PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
wiwski committed Dec 5, 2022
1 parent 2bf5913 commit 0763dd6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 41 deletions.
58 changes: 17 additions & 41 deletions .github/workflows/automerge-dependabot.yaml
Original file line number Diff line number Diff line change
@@ -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}}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
_static/**
**/assets/dist/**
.github/workflows/automerge-dependabot.yaml

0 comments on commit 0763dd6

Please sign in to comment.