From 3dd5b99cf7fdc082a48f10299e1a14d44dccc549 Mon Sep 17 00:00:00 2001 From: Kyle Durand Date: Fri, 1 Nov 2024 13:50:37 -0400 Subject: [PATCH] fix: dependabot run only when checks pass (#12860) --- .github/workflows/dependabot-auto-merge.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml index 67a470b6b84..b5bed10db88 100644 --- a/.github/workflows/dependabot-auto-merge.yml +++ b/.github/workflows/dependabot-auto-merge.yml @@ -1,5 +1,8 @@ name: Dependabot auto-merge -on: pull_request_target +on: + pull_request: + check_suite: + types: [completed] permissions: pull-requests: write @@ -82,8 +85,8 @@ jobs: const statusResponse = await github.graphql(checkStatusQuery, repoInfo) const checkState = statusResponse.repository.pullRequest.commits.nodes[0]?.commit?.statusCheckRollup?.state - if (checkState !== 'SUCCESS') { - console.log('Status checks are not successful yet. Current state:', checkState) + if (checkState === 'FAILURE' || checkState === 'ERROR') { + console.log('Status checks failed. Current state:', checkState) core.setFailed('Status checks must pass before enabling auto-merge') return }