From efc9af43416e5d4e388b02cbad5051ba1a5a9e40 Mon Sep 17 00:00:00 2001 From: M Atif Ali Date: Mon, 3 Feb 2025 17:04:22 +0500 Subject: [PATCH] ci: notify dependabot PR merges on `pull_request` `closed` events (#16381) --- .github/workflows/dependabot.yaml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dependabot.yaml b/.github/workflows/dependabot.yaml index 79c2f89dbe..e2e953aab2 100644 --- a/.github/workflows/dependabot.yaml +++ b/.github/workflows/dependabot.yaml @@ -1,12 +1,9 @@ name: dependabot +# Dependabot is annoying, but this makes it a bit less so. on: pull_request: - types: - - opened - push: - branches: - - main + types: [opened, closed] permissions: contents: read @@ -15,10 +12,14 @@ permissions: concurrency: pr-${{ github.ref }} jobs: - # Dependabot is annoying, but this makes it a bit less so. dependabot-automerge: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' && github.actor_id == 49699333 && github.repository == 'coder/coder' + if: > + github.event_name == 'pull_request' && + github.event.action == 'opened' && + github.event.pull_request.user.login == 'dependabot[bot]' && + github.actor_id == 49699333 && + github.repository == 'coder/coder' permissions: pull-requests: write contents: write @@ -48,7 +49,12 @@ jobs: dependabot-automerge-notify: # Send a slack notification when a dependabot PR is merged. runs-on: ubuntu-latest - if: github.event_name == 'push' && github.actor == 'github-actions[bot]' && github.actor_id == 41898282 && github.repository == 'coder/coder' + if: > + github.event_name == 'pull_request' && + github.event.action == 'closed' && + github.event.pull_request.merged == true && + github.event.pull_request.user.login == 'dependabot[bot]' && + github.repository == 'coder/coder' steps: - name: Send Slack notification env: