Skip to content

Commit ecb7f0f

Browse files
authored
chore(workflows): Adding notification workflows for new issues, comments and releases. (#1758)
1 parent 8fec653 commit ecb7f0f

File tree

3 files changed

+89
-0
lines changed

3 files changed

+89
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Notify Comments on Pending/Closing Soon Issues
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on comment events on pending response issues
8+
issue_comment:
9+
types: [created]
10+
11+
# Limit the GITHUB_TOKEN permissions
12+
permissions: {}
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "notify"
17+
notify:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
21+
if: ${{ !github.event.issue.pull_request && (contains(github.event.issue.labels.*.name, 'pending-response') || contains(github.event.issue.labels.*.name, 'closing soon')) }}
22+
23+
# Steps represent a sequence of tasks that will be executed as part of the job
24+
steps:
25+
# Runs a single command using the runners shell
26+
- name: Run webhook curl command
27+
env:
28+
WEBHOOK_URL: ${{ secrets.SLACK_COMMENT_WEBHOOK_URL }}
29+
COMMENT: ${{toJson(github.event.comment.body)}}
30+
shell: bash
31+
run: echo $COMMENT | sed "s/\\\n/. /g; s/\\\r//g; s/[^a-zA-Z0-9 &().,:]//g" | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"comment":"{}", "commentUrl":"${{github.event.comment.html_url}}", "user":"${{github.event.comment.user.login}}"}'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Notify New Issues
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on comment events on pending response issues
8+
issues:
9+
types: [opened]
10+
11+
# Limit the GITHUB_TOKEN permissions
12+
permissions: {}
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "notify"
17+
notify:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
# Runs a single command using the runners shell
24+
- name: Run webhook curl command
25+
env:
26+
WEBHOOK_URL: ${{ secrets.SLACK_ISSUE_WEBHOOK_URL }}
27+
ISSUE: ${{toJson(github.event.issue.title)}}
28+
shell: bash
29+
run: echo $ISSUE | sed 's/[^a-zA-Z0-9 &().,:]//g' | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"issue":"{}", "issueUrl":"${{github.event.issue.html_url}}", "user":"${{github.event.issue.user.login}}"}'
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Notify Amplify iOS Release
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on release created (draft) or released (stable) events but only for the main branch
8+
release:
9+
types: [created, released]
10+
11+
# Limit the GITHUB_TOKEN permissions
12+
permissions: {}
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "notify"
17+
notify:
18+
# The type of runner that the job will run on
19+
runs-on: ubuntu-latest
20+
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
# Runs a single command using the runners shell
24+
- name: Run webhook curl command
25+
env:
26+
WEBHOOK_URL: ${{ secrets.SLACK_RELEASE_WEBHOOK_URL }}
27+
VERSION: $${{github.event.release.html_url}}
28+
shell: bash
29+
run: echo $VERSION | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"action":"${{github.event.action}}", "repo":"${{github.event.repository.html_url}}", "version":"{}"}'

0 commit comments

Comments
 (0)