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 : Issue Opened Slack Notification
2+
3+ # This workflow runs only when a new issue is opened.
4+ on :
5+ issues :
6+ types : [opened]
7+
8+
9+ jobs :
10+ notify_slack_on_issue :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - name : Send Slack Notification for New Issue
14+ run : |
15+ MESSAGE_TEXT="*📢 New Issue Opened in ${{ github.repository }} 📢*\n\n*Issue Title:* ${{ github.event.issue.title }}\n*Opened By:* ${{ github.event.issue.user.login }}\n\n*View Issue:* ${{ github.event.issue.html_url }}"
16+
17+ SLACK_PAYLOAD=$(jq -n \
18+ --arg text "${MESSAGE_TEXT}" \
19+ '{
20+ "channel": "#docs-devdocs-notifications",
21+ "username": "Issue Notifier",
22+ "icon_emoji": ":mega:",
23+ "text": $text
24+ }')
25+
26+ curl -X POST \
27+ -H 'Content-type: application/json' \
28+ --data "$SLACK_PAYLOAD" \
29+ ${{ secrets.SLACK_WEBHOOK }}
You can’t perform that action at this time.
0 commit comments