-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add template example slack (#17)
- Loading branch information
1 parent
6a0356c
commit fca8630
Showing
1 changed file
with
55 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ jobs: | |
steps: | ||
|
||
- name: Release Notification | ||
uses: thedaviddias/publish-release-info-action@v1.1.1 | ||
uses: thedaviddias/publish-release-info-action@vX.X.X | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
slack_webhook_url: https://hooks.slack.com/services/XXXXXX/XXXXX/XXXXXXX | ||
|
@@ -113,12 +113,65 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Release Notification | ||
uses: thedaviddias/publish-release-info-action@v1.1.1 | ||
uses: thedaviddias/publish-release-info-action@vX.X.X | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
``` | ||
|
||
### Example Workflow with Custom Slack template | ||
|
||
We can use the output from `publish-relase-info-action` and use in combinaison with other actions like [slack-send](https://github.com/marketplace/actions/slack-send) in case you want to use a custom notification template. | ||
|
||
```yaml | ||
name: Deploy to production | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Release Notification | ||
uses: thedaviddias/[email protected] | ||
id: release | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Post to a Slack channel | ||
uses: slackapi/[email protected] | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
with: | ||
channel-id: 'CHANNEL_ID' | ||
payload: | | ||
{ | ||
"text": "New release!", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Project:*\n<${{ steps.release.outputs.repoLink }}|${{ steps.release.outputs.repo}}>", | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Version:*\n<${{ steps.release.outputs.releaseLink }}|${{ steps.release.outputs.releaseVersion }}>", | ||
} | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
## Contributors | ||
|
||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> | ||
|