File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Notify DevDocs on Reviews
2+
3+ on :
4+ pull_request_review_comment :
5+ types : [created, edited]
6+ pull_request :
7+ types : [opened, edited]
8+ pull_request_review :
9+ types : [submitted, edited]
10+
11+ jobs :
12+ notify :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Check for @DevDocs mention and send to Slack
16+ uses : actions/github-script@v7
17+ with :
18+ script : |
19+ const text = context.payload.comment?.body
20+ || context.payload.issue?.body
21+ || context.payload.pull_request?.body
22+ || context.payload.review?.body
23+ || "";
24+
25+ if (text.includes("@DevDocs") || text.includes("@10gen/devdocs")) {
26+ await fetch(process.env.SLACK_WEBHOOK_URL, {
27+ method: "POST",
28+ headers: { "Content-Type": "application/json" },
29+ body: JSON.stringify({
30+ text: `:eyes: @DevDocs has been mentioned in *${context.payload.repository.full_name}*
31+ Event: *${context.eventName}*
32+ Link: ${context.payload.comment?.html_url
33+ || context.payload.issue?.html_url
34+ || context.payload.pull_request?.html_url
35+ || context.payload.review?.html_url}`
36+ }),
37+ });
38+ }
39+ env :
40+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
You can’t perform that action at this time.
0 commit comments