Skip to content

Commit 93f3d3d

Browse files
authored
Move inline values to environment variables in workflows (#3368)
1 parent 04bd7b9 commit 93f3d3d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/notify_comments.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ jobs:
2424
env:
2525
WEBHOOK_URL: ${{ secrets.SLACK_COMMENT_WEBHOOK_URL }}
2626
BODY: ${{ toJson(github.event.comment.body) }}
27+
COMMENT_URL: ${{ github.event.comment.html_url }}
2728
shell: bash
28-
run: echo $BODY | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"issue":"${{github.event.comment.html_url}}", "body":"{}"}'
29+
run: echo $BODY | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"issue":"'$COMMENT_URL'", "body":"{}"}'

.github/workflows/notify_release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ jobs:
2121
- name: Run webhook curl command
2222
env:
2323
WEBHOOK_URL: ${{ secrets.SLACK_RELEASE_WEBHOOK_URL }}
24+
ACTION_NAME: ${{ github.event.action }}
25+
REPO_URL: ${{ github.event.repository.html_url }}
26+
VERSION: ${{ github.event.release.html_url }}
2427
shell: bash
25-
run: curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"action":"${{github.event.action}}", "repo":"${{github.event.repository.html_url}}", "version":"${{github.event.release.html_url}}"}'
28+
run: curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"action":"'$ACTION_NAME'", "repo":"'$REPO_URL'", "version":"'$VERSION'"}'

0 commit comments

Comments
 (0)