Skip to content

Commit

Permalink
Merge pull request #298 from amazreech/master
Browse files Browse the repository at this point in the history
chore: add a new workflow file to send notifications on new PRs, issues, and comments
  • Loading branch information
amazreech committed May 16, 2024
2 parents b54b045 + d464454 commit 088475a
Showing 1 changed file with 57 additions and 0 deletions.
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/slack-github-action@v1.26.0
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/slack-github-action@v1.26.0
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/slack-github-action@v1.26.0
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 }}

0 comments on commit 088475a

Please sign in to comment.