forked from instana/go-sensor
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.49 KB
/
slack_notification.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Slack Post
run-name: Posting the release in ${{ github.event.release.name }} to slack
on:
release:
types: [published]
jobs:
publish-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Send success message to slack release channel
if: "${{ success() && env.DRY_RUN != 'true' }}"
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
{
"text": ":mega: *Go Tracer team* : Go package ${{ github.event.release.name }} has been released",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":mega: *Go Tracer team* : Go package <${{ github.event.release.html_url }}|${{ github.event.release.name }}> has been released. :tada:"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Release link: <${{ github.event.release.html_url }}|${{ github.event.release.html_url }}>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_RELEASE_CHANNEL_ID: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}