From ba580b8a28870543523357e972cebea5786ee918 Mon Sep 17 00:00:00 2001 From: "Andrew S. Rosen" Date: Mon, 7 Sep 2026 17:05:52 -0400 Subject: [PATCH] Enable auto-merge for pre-commit.ci PRs --- .github/workflows/dependabot-auto-merge.yaml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dependabot-auto-merge.yaml b/.github/workflows/dependabot-auto-merge.yaml index d5b8e15..2d50f6f 100644 --- a/.github/workflows/dependabot-auto-merge.yaml +++ b/.github/workflows/dependabot-auto-merge.yaml @@ -1,4 +1,4 @@ -name: Dependabot auto-merge +name: Dependency bot auto-merge on: workflow_run: @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - - name: Enable auto-merge for current Dependabot PRs + - name: Enable auto-merge for current dependency bot PRs uses: actions/github-script@v9 env: GH_TOKEN: ${{ github.token }} @@ -23,6 +23,10 @@ jobs: script: | const { owner, repo } = context.repo; const candidates = context.payload.workflow_run.pull_requests ?? []; + const allowedBots = new Set([ + "dependabot[bot]", + "pre-commit-ci[bot]", + ]); for (const candidate of candidates) { const { data: pullRequest } = await github.rest.pulls.get({ @@ -31,8 +35,8 @@ jobs: pull_number: candidate.number, }); - if (pullRequest.user.login !== "dependabot[bot]") { - core.info(`Skipping PR #${pullRequest.number}: not opened by Dependabot.`); + if (!allowedBots.has(pullRequest.user.login)) { + core.info(`Skipping PR #${pullRequest.number}: not opened by an allowed dependency bot.`); continue; }