Skip to content

Commit d94622a

Browse files
Merge pull request #59 from mongodb/antoniomorello-DB-patch-1
Create devdocs-notify.yml for when a PR is created
2 parents 809c880 + b83b95f commit d94622a

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: DevDocs PR or Issue Creation Notifier
2+
on:
3+
pull_request:
4+
types: [opened]
5+
6+
jobs:
7+
notify:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Check for new PR or issues
11+
uses: actions/github-script@v7
12+
with:
13+
script: |
14+
const text = context.payload.comment?.body
15+
|| context.payload.issue?.body
16+
|| context.payload.pull_request?.body
17+
|| context.payload.review?.body
18+
|| "";
19+
20+
await fetch(process.env.SLACK_WEBHOOK_URL, {
21+
method: "POST",
22+
headers: { "Content-Type": "application/json" },
23+
body: JSON.stringify({
24+
text: `:eyes: @DevDocs a PR was opened in *${context.payload.repository.full_name}*
25+
Event: *${context.eventName}*
26+
Link: ${context.payload.comment?.html_url
27+
|| context.payload.issue?.html_url
28+
|| context.payload.pull_request?.html_url
29+
|| context.payload.review?.html_url}`
30+
}),
31+
});
32+
env:
33+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
"metadata": "/snippets/triggers/project/manifest.json"
2323
}
2424
],
25-
"version": "5ecb1bb545fba2bae516638e3e099094d5553f58"
25+
"version": "a4f0e8250870b34abc7dca13d2ad79ec687d1f25"
2626
}

0 commit comments

Comments
 (0)