-
Notifications
You must be signed in to change notification settings - Fork 11
49 lines (45 loc) · 1.4 KB
/
Copy path_release-notifications.yaml
File metadata and controls
49 lines (45 loc) · 1.4 KB
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
42
43
44
45
46
47
48
49
# Send a Slack release notification. Instructions to set up Slack to receive
# messages can be found here: https://github.com/slackapi/slack-github-action#setup-2
#
# yamllint disable rule:document-start rule:document-end
name: Release Notifications
on: # yamllint disable-line rule:truthy
workflow_call:
inputs:
repo_name:
required: true
type: string
release_tag:
required: true
type: string
release_url:
required: true
type: string
secrets:
SLACK_WEBHOOK_URL:
required: true
# Grant no permissions to this workflow.
permissions: {}
jobs:
slack:
name: Slack release notification
runs-on: ubuntu-latest
steps:
- name: Notify via Slack
run: |
curl --header "Content-Type: application/json; charset=UTF-8" --request POST --data "$SLACK_WEBHOOK_MSG" "$SLACK_WEBHOOK_URL"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_MSG: |
{
"text": "${{ inputs.repo_name }} published a new release ${{ inputs.release_tag }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*${{ inputs.repo_name }}* published a new release <${{ inputs.release_url }}|${{ inputs.release_tag }}>"
}
}
]
}