Skip to content

Commit

Permalink
fix: dependabot run only when checks pass (#12860)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyledurand authored Nov 1, 2024
1 parent 1e0f461 commit 3dd5b99
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Dependabot auto-merge
on: pull_request_target
on:
pull_request:
check_suite:
types: [completed]

permissions:
pull-requests: write
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 3dd5b99

Please sign in to comment.