Skip to content

Commit 3dd5b99

Browse files
authored
fix: dependabot run only when checks pass (#12860)
1 parent 1e0f461 commit 3dd5b99

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/dependabot-auto-merge.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Dependabot auto-merge
2-
on: pull_request_target
2+
on:
3+
pull_request:
4+
check_suite:
5+
types: [completed]
36

47
permissions:
58
pull-requests: write
@@ -82,8 +85,8 @@ jobs:
8285
const statusResponse = await github.graphql(checkStatusQuery, repoInfo)
8386
const checkState = statusResponse.repository.pullRequest.commits.nodes[0]?.commit?.statusCheckRollup?.state
8487
85-
if (checkState !== 'SUCCESS') {
86-
console.log('Status checks are not successful yet. Current state:', checkState)
88+
if (checkState === 'FAILURE' || checkState === 'ERROR') {
89+
console.log('Status checks failed. Current state:', checkState)
8790
core.setFailed('Status checks must pass before enabling auto-merge')
8891
return
8992
}

0 commit comments

Comments
 (0)