Skip to content

Commit 3cea2fe

Browse files
authored
chore: Add action to send PRs and issues to internal slack (aws#8607)
* Add workflow to send new PRs and issues to internal slack * add notify slack action
1 parent 5f85547 commit 3cea2fe

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/notify-slack.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Slack Notifications
2+
3+
on:
4+
pull_request:
5+
types: [labeled]
6+
issues:
7+
types: [opened]
8+
9+
jobs:
10+
notify-slack:
11+
runs-on: ubuntu-latest
12+
if: (github.event_name == 'pull_request' && github.event.label.name == 'pr/external') || github.event_name == 'issues'
13+
permissions:
14+
contents: read
15+
steps:
16+
- name: Send External PR Notification
17+
if: github.event_name == 'pull_request'
18+
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2
19+
env:
20+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
21+
SLACK_TITLE: 'PR Created: ${{ github.event.pull_request.title }} by ${{ github.event.pull_request.user.login }}'
22+
SLACK_FOOTER: ''
23+
MSG_MINIMAL: true
24+
SLACK_MESSAGE: '${{ github.event.pull_request.html_url }}'
25+
- name: Send New Issue Notification
26+
if: github.event_name == 'issues'
27+
uses: rtCamp/action-slack-notify@e31e87e03dd19038e411e38ae27cbad084a90661 # v2
28+
env:
29+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
30+
SLACK_TITLE: 'Issue Created: ${{ github.event.issue.title }} by ${{ github.event.issue.user.login }}'
31+
SLACK_FOOTER: ''
32+
MSG_MINIMAL: true
33+
SLACK_MESSAGE: '${{ github.event.issue.html_url }}'

0 commit comments

Comments
 (0)