Skip to content

Commit

Permalink
chore: Tweaking notification workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ruisebas committed Oct 3, 2023
1 parent fc9fe26 commit c976edf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/notify_issue_comment.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions

name: Notify Comments on Pending/Closing Soon Issues
name: Notify Comments on Issues

# Controls when the workflow will run
on:
Expand All @@ -18,7 +18,8 @@ jobs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

if: ${{ !github.event.issue.pull_request && !contains(fromJSON('["palpatim", "jcjimenez", "5d", "lawmicha", "harsh62", "thisisabhash", "royjit", "atierian", "ukhan-amazon", "ruisebas", "phantumcode"]'), github.event.comment.user.login) }}
# Exclude comments in PRs and comments made from maintainers
if: ${{ !github.event.issue.pull_request && !contains(fromJSON('["CONTRIBUTOR", "MEMBER", "OWNER"]'), github.event.comment.author_association) }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -27,7 +28,7 @@ jobs:
env:
WEBHOOK_URL: ${{ secrets.SLACK_COMMENT_WEBHOOK_URL }}
COMMENT: ${{toJson(github.event.comment.body)}}
USER: ${{github.event.issue.user.login}}
USER: ${{github.event.comment.user.login}}
COMMENT_URL: ${{github.event.comment.html_url}}
shell: bash
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":"'$COMMENT_URL'", "user":"'$USER'"}'
3 changes: 3 additions & 0 deletions .github/workflows/notify_new_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Exclude issues opened by maintainers
if: ${{ !contains(fromJSON('["CONTRIBUTOR", "MEMBER", "OWNER"]'), github.event.issue.author_association) }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/notify_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: Notify Amplify iOS Release

# Controls when the workflow will run
on:
# Triggers the workflow on release created (draft) or released (stable) events but only for the main branch
# Triggers the workflow on released events
release:
types: [created, released]
types: [released]

# Limit the GITHUB_TOKEN permissions
permissions: {}
Expand Down

0 comments on commit c976edf

Please sign in to comment.