forked from aws-actions/amazon-ecs-render-task-definition
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request aws-actions#298 from amazreech/master
chore: add a new workflow file to send notifications on new PRs, issues, and comments
- Loading branch information
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |