From d32f3dcb974644077db51e76a7767ee18fc13bc8 Mon Sep 17 00:00:00 2001 From: Tobias Raabe Date: Thu, 18 Dec 2025 08:48:20 +0100 Subject: [PATCH] Enable automerge for pre-commit and dependabot. --- .github/workflows/automerge.yml | 20 ++++++++++++++++++++ justfile | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/automerge.yml diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml new file mode 100644 index 00000000..7f35b34f --- /dev/null +++ b/.github/workflows/automerge.yml @@ -0,0 +1,20 @@ +name: Dependabot and Pre-commit auto-merge + +on: + pull_request: + +permissions: + contents: write + +jobs: + auto-merge: + runs-on: ubuntu-latest + if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' }} + steps: + - name: Enable auto-merge for Dependabot and pre-commit-ci PRs + 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 }} diff --git a/justfile b/justfile index bc00ad27..f8e27aca 100644 --- a/justfile +++ b/justfile @@ -24,7 +24,7 @@ typing-nb: # Run linting lint: - uvx --with pre-commit-uv pre-commit run -a + uvx prek run -a # Run all checks (format, lint, typing, test) check: lint typing test