Skip to content

Commit 6f87df4

Browse files
committed
Changing logic to trigger on pull_request because lint status check has been applied in Settings > Code and automation > Branches.
1 parent 592b4c2 commit 6f87df4

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

.github/workflows/dependabot.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
name: Dependabot pull requests
22

3-
on:
4-
workflow_run:
5-
workflows: ["Linting"]
6-
types:
7-
- completed
3+
on: pull_request
84

95
jobs:
106
dependabot:
117
name: Auto-merge Dependabot PRs
128
runs-on: ubuntu-latest
13-
# Only trigger if tests have passed on a Dependabot-created PR
14-
if: |
15-
github.event.workflow_run.conclusion == 'success' &&
16-
github.event.workflow_run.pull_requests != '' &&
17-
startsWith(github.event.workflow_run.head_branch, 'dependabot/') &&
18-
github.event.workflow_run.pull_requests[0].user.login == 'dependabot[bot]'
9+
if: ${{github.event.pull_request.user.login == 'dependabot[bot]'}}
1910
permissions:
2011
pull-requests: write
2112
contents: write
2213
env:
2314
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24-
PR_URL: ${{ github.event.workflow_run.pull_requests[0].html_url }}
15+
PR_URL: ${{ github.event.pull_request.html_url }}
2516
steps:
17+
- name: Approve the PR
18+
run: gh pr review --approve "$PR_URL"
2619
- name: Merge the PR
2720
run: gh pr merge --squash --auto "$PR_URL"

0 commit comments

Comments
 (0)