Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add a new workflow file to send notifications on new PRs, issues, and comments #298

Merged
merged 1 commit into from
May 16, 2024
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
57 changes: 57 additions & 0 deletions .github/workflows/notifications.file
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Send Notifications to Slack
on:
pull_request:
types: [opened, reopened]
issues:
types: [opened]
issue_comment:
types: [created]

jobs:
issue-notifications:
name: Send Notifications
runs-on: ubuntu-latest

steps:
- name: Send notifications on Pull Request
if: ${{ github.event_name == 'pull_request'}}
id: slack_PR
uses: slackapi/[email protected]
with:
payload: |
{
"Notification Type": "Pull Request",
"Notification URL":"${{ github.event.pull_request.html_url }}",
"GitHub Repo": "${{ github.repository }}",
"Notification Title": "${{ github.event.pull_request.title }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Send notification on new issues
if: ${{github.event_name == 'issues'}}
id: slack_issue
uses: slackapi/[email protected]
with:
payload: |
{
"Notification Type": "Issue",
"Notification URL":"${{ github.event.issue.html_url }}",
"GitHub Repo": "${{ github.repository }}",
"Notification Title": "${{ github.event.issue.title }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Send notification on Issues and Pull Requests Comments
if: ${{github.event_name == 'issue_comment'}}
id: slack_issue_comment
uses: slackapi/[email protected]
with:
payload: |
{
"Notification Type": "Issue comment",
"Notification URL":"${{ github.event.comment.html_url }}",
"GitHub Repo": "${{ github.repository }}",
"Notification Title": "${{ github.event.issue_comment.issue.title }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Loading