-
Notifications
You must be signed in to change notification settings - Fork 11
50 lines (46 loc) · 1.5 KB
/
_release-notifications.yaml
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
50
# 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
name: Release Notifications
on:
workflow_call:
inputs:
repo-name:
type: string
required: true
description: Repository name used for the notification
release-tag:
type: string
required: true
description: Tag name of the release for the notification
release-url:
type: string
required: true
description: URL to the release page for the notification
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 }}>"
}
}
]
}