Skip to content

Commit d8d6f60

Browse files
authored
chore: Updating notify actions to use env vars (#2880)
* chore: Updating notify actions to use env vars * Update notify_issue_comment.yml
1 parent 89789ee commit d8d6f60

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/notify_issue_comment.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# The type of runner that the job will run on
1919
runs-on: ubuntu-latest
2020

21-
if: ${{ !github.event.issue.pull_request && !contains(fromJSON('["palpatim", "brennanMKE", "diegocstn", "lawmicha", "harsh62", "thisisabhash", "ameter", "royjit", "atierian", "ukhan-amazon", "ruisebas", "phantumcode"]'), github.event.comment.user.login) }}
21+
if: ${{ !github.event.issue.pull_request && !contains(fromJSON('["palpatim", "jcjimenez", "5d", "lawmicha", "harsh62", "thisisabhash", "ameter", "royjit", "atierian", "ukhan-amazon", "ruisebas", "phantumcode"]'), github.event.comment.user.login) }}
2222

2323
# Steps represent a sequence of tasks that will be executed as part of the job
2424
steps:
@@ -27,5 +27,7 @@ jobs:
2727
env:
2828
WEBHOOK_URL: ${{ secrets.SLACK_COMMENT_WEBHOOK_URL }}
2929
COMMENT: ${{toJson(github.event.comment.body)}}
30+
USER: ${{github.event.issue.user.login}}
31+
COMMENT_URL: ${{github.event.comment.html_url}}
3032
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}}"}'
33+
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"}'

.github/workflows/notify_new_issue.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,7 @@ jobs:
2525
env:
2626
WEBHOOK_URL: ${{ secrets.SLACK_ISSUE_WEBHOOK_URL }}
2727
ISSUE: ${{toJson(github.event.issue.title)}}
28+
ISSUE_URL: ${{github.event.issue.html_url}}
29+
USER: ${{github.event.issue.user.login}}
2830
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}}"}'
31+
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":"$ISSUE_URL", "user":"$USER"}'

0 commit comments

Comments
 (0)