Discussions Notification #372
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
name: Discussions Notification | |
on: | |
discussion: | |
types: created | |
discussion_comment: | |
types: created | |
jobs: | |
slackNotification: | |
name: Slack Notification Demo | |
runs-on: ubuntu-latest | |
steps: | |
- name: $github | |
run: echo "$GITHUB_CONTEXT" | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
- name: Post discussion to a Slack channel | |
if: github.event_name == 'discussion' | |
uses: slackapi/slack-github-action@v1.14.0 | |
with: | |
channel-id: 'C022NLSRAJU' # Slack channel id to post message | |
slack-message: | | |
There is a new <${{ github.event.discussion.html_url }}|discussion> from ${{ github.actor }} in the Battlesnake Feedback Repo! | |
>>> ${{ github.event.discussion.title }} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
- name: Post discussion comment to a Slack channel | |
if: github.event_name == 'discussion_comment' | |
uses: slackapi/slack-github-action@v1.14.0 | |
with: | |
channel-id: 'C022NLSRAJU' # Slack channel id to post message | |
slack-message: | | |
There is a new comment from ${{ github.actor }} on <${{ github.event.discussion.html_url }}|${{ github.event.discussion.title }}> | |
>>> ${{ github.event.comment.body }} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |