Skip to content

Commit cfb86ab

Browse files
authored
ci: fix cla and dependabot notifications
1 parent 1aee589 commit cfb86ab

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/workflows/contrib.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,24 @@ name: contrib
22

33
on:
44
issue_comment:
5-
types: [created]
6-
pull_request:
5+
types: [created, edited]
6+
pull_request_target: # for community
77
types:
88
- opened
99
- closed
1010
- synchronize
1111
- labeled
1212
- unlabeled
13-
- opened
1413
- reopened
1514
- edited
1615
# For jobs that don't run on draft PRs.
1716
- ready_for_review
17+
pull_request: # for dependabot PRs
18+
types:
19+
- opened
20+
push:
21+
branches:
22+
- main
1823

1924
permissions:
2025
contents: read
@@ -43,7 +48,7 @@ jobs:
4348
PR_URL: ${{github.event.pull_request.html_url}}
4449
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
4550

46-
- name: Enable auto-merge for Dependabot PRs
51+
- name: Enable auto-merge
4752
run: gh pr merge --auto --squash "$PR_URL"
4853
env:
4954
PR_URL: ${{github.event.pull_request.html_url}}
@@ -52,7 +57,7 @@ jobs:
5257
dependabot-automerge-notify:
5358
# Send a slack notification when a dependabot PR is merged.
5459
runs-on: ubuntu-latest
55-
if: github.event_name == 'pull_request' && github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'coder/coder' && github.event.pull_request.merged
60+
if: github.event_name == 'push' && github.actor == 'github-actions[bot]'
5661
steps:
5762
- name: Send Slack notification
5863
env:
@@ -104,7 +109,7 @@ jobs:
104109
pull-requests: write
105110
steps:
106111
- name: cla
107-
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request'
112+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
108113
uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1
109114
env:
110115
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)