Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/slack-notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Slack Notifications
on:
issues:
types: [opened]
pull_request:
types: [opened]
issue_comment:
types: [created]

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send to Slack
run: |
if [ "${{ github.event_name }}" = "issues" ]; then
TITLE="${{ github.event.issue.title }}"
URL="${{ github.event.issue.html_url }}"
EVENT="🟢 New Issue"
elif [ "${{ github.event_name }}" = "pull_request" ]; then
TITLE="${{ github.event.pull_request.title }}"
URL="${{ github.event.pull_request.html_url }}"
EVENT="🔵 New PR"
elif [ "${{ github.event_name }}" = "issue_comment" ]; then
TITLE="${{ github.event.issue.title }}"
URL="${{ github.event.comment.html_url }}"
EVENT="💬 New Comment"
fi

curl -X POST "${{ secrets.SLACK_WEBHOOK_URL }}" \
-H "Content-Type: application/json" \
-d "{\"repo\":\"${{ github.repository }}\",\"event\":\"$EVENT\",\"title\":\"$TITLE\",\"url\":\"$URL\",\"user\":\"${{ github.actor }}\"}"
Loading