-
Notifications
You must be signed in to change notification settings - Fork 717
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 #11564 from vkWeb/slack-hi-from-gh
Notify our slack on contributors' issue comments
- Loading branch information
Showing
1 changed file
with
31 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,31 @@ | ||
name: Send a slack notification when a contributor comments on issue | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
contributor_issue_comment: | ||
name: Contributor issue comment | ||
|
||
if: >- | ||
${{ | ||
!github.event.issue.pull_request && | ||
github.event.comment.author_association != 'MEMBER' && | ||
github.event.comment.author_association != 'OWNER' | ||
}} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send message to Slack channel | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
run: | | ||
ISSUE_TITLE="${{ github.event.issue.title }} by ${GITHUB_ACTOR}" | ||
ISSUE_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/issues/${{ github.event.issue.number }}" | ||
ISSUE_COMMENT_URL="${ISSUE_URL}#issuecomment-${{ github.event.comment.id }}" | ||
JSON_TEXT="{\"text\": \"*New comment on issue: <${ISSUE_COMMENT_URL}|${ISSUE_TITLE}>*\"}" | ||
curl -X POST -H 'Content-type: application/json' \ | ||
--data "$JSON_TEXT" \ | ||
$SLACK_WEBHOOK_URL |