File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Notify Slack on Pull Request Upload
2+
3+ on :
4+ pull_request :
5+ types : [opened]
6+
7+ jobs :
8+ slack_notification :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Send Slack notification
12+ uses : slackapi/slack-github-action@v1.27.0
13+ with :
14+ payload : |
15+ {
16+ "text": ":bell: *New Pull Request!*",
17+ "blocks": [
18+ {
19+ "type": "section",
20+ "text": {
21+ "type": "mrkdwn",
22+ "text": ":sparkles: *${{ github.actor }}* opened a PR"
23+ }
24+ },
25+ {
26+ "type": "section",
27+ "fields": [
28+ {
29+ "type": "mrkdwn",
30+ "text": "*Title:*\n${{ github.event.pull_request.title }}"
31+ },
32+ {
33+ "type": "mrkdwn",
34+ "text": "*Base Branch:*\n${{ github.base_ref }}"
35+ },
36+ {
37+ "type": "mrkdwn",
38+ "text": "*From Branch:*\n${{ github.head_ref }}"
39+ },
40+ {
41+ "type": "mrkdwn",
42+ "text": "*Link:*\n<${{ github.event.pull_request.html_url }}|View PR>"
43+ }
44+ ]
45+ }
46+ ]
47+ }
48+ env :
49+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
You can’t perform that action at this time.
0 commit comments