-
Notifications
You must be signed in to change notification settings - Fork 116
39 lines (34 loc) · 1.51 KB
/
on_release_publish.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
name: On Release Publish
on:
release:
types: [published]
jobs:
slack-notifications:
runs-on: ubuntu-latest
name: Sends a message to Slack when a package is released
steps:
- uses: actions/checkout@v3
- run: |
echo "${{ github.event.release.tag_name }}"
echo "${{ github.event.release.name }}"
echo "${{ github.event.release.body }}"
- name: Send message to Slack API
uses: archive/github-actions-slack@master
id: send-message
with:
slack-function: send-message
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}
slack-channel: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
slack-text: ${{ github.event.release.tag_name }} has been released.
- name: Result from "Send Message"
run: echo "The result was ${{ steps.notify.outputs.slack-result }}"
- name: Send Thread Message
uses: archive/github-actions-slack@master
with:
slack-function: send-message
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_USER_OAUTH_ACCESS_TOKEN }}
slack-channel: ${{ fromJson(steps.send-message.outputs.slack-result).response.channel }}
slack-optional-thread_ts: ${{ fromJson(steps.send-message.outputs.slack-result).response.message.ts }}
slack-text: ${{ github.event.release.body }}
- name: Send "Send Thread Message" Result
run: echo "Data - ${{ steps.send-message.outputs.slack-result }}"