Skip to content

Commit 1398c04

Browse files
authored
build: notify via slack when review-wanted
I have noticed we don't have a usual workflow for review-wanted PRs. So, in other words the label is not useful as it should be. This commit notify via Slack (#node-core) whenever this label is placed either on an issue or in a PR. PR-URL: #55102 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
1 parent b5fb2ff commit 1398c04

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Notify on Review Wanted
2+
on:
3+
issues:
4+
types: [labeled]
5+
pull_request_target:
6+
types: [labeled]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
notifyOnReviewWanted:
13+
name: Notify on Review Wanted
14+
if: github.repository == 'nodejs/node' && github.event.label == 'review wanted'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Determine PR or Issue
18+
id: define-message
19+
run: |
20+
if [[ -n "${{ github.event.pull_request.number }}" ]]; then
21+
number="${{ github.event.pull_request.number }}"
22+
link="https://github.com/${{ github.repository }}/pull/$number"
23+
echo "message=The PR (#$number) requires review from Node.js maintainers. See: $link" >> "$GITHUB_OUTPUT"
24+
echo "title=${{ github.actor }} asks for attention on pull request #$number" >> "$GITHUB_OUTPUT"
25+
else
26+
number="${{ github.event.issue.number }}"
27+
link="https://github.com/${{ github.repository }}/issues/$number"
28+
echo "message=The issue (#$number) requires review from Node.js maintainers. See: $link" >> "$GITHUB_OUTPUT"
29+
echo "title=${{ github.actor }} asks for attention on issue #$number" >> "$GITHUB_OUTPUT"
30+
fi
31+
32+
- name: Slack Notification
33+
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907 # 2.3.0
34+
env:
35+
SLACK_COLOR: '#DE512A'
36+
SLACK_ICON: https://github.com/nodejs.png?size=48
37+
SLACK_TITLE: ${{ steps.define-message.outputs.title }}
38+
SLACK_MESSAGE: ${{ steps.define-message.outputs.message }}
39+
SLACK_USERNAME: nodejs-bot
40+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)