-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PDCL-7927: add yaml file for notifying slack of release
- Loading branch information
Brent Hosie
committed
Mar 29, 2022
1 parent
69dc280
commit 293b2c3
Showing
2 changed files
with
49 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: CI notify | ||
|
||
# Only trigger, when the build workflow succeeded | ||
on: | ||
workflow_run: | ||
workflows: ['Node.js Package'] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
notify-on-success: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Get latest tag | ||
uses: oprypin/find-latest-tag@v1 | ||
with: | ||
repository: "${{ github.repository }}" # The repository to scan. | ||
releases-only: true # We know that all relevant tags have a GitHub release for them. | ||
id: repoTag # The step ID to refer to later. | ||
- name: Show ENV | ||
run: env | ||
- name: Notify Slack of Release | ||
uses: tokorom/action-slack-incoming-webhook@main | ||
env: | ||
INCOMING_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
with: | ||
text: "A new version of ${{ github.event.repository.full_name }}[${{ steps.repoTag.outputs.tag }}] has been released" | ||
attachments: | | ||
[ | ||
{ | ||
"color": "good", | ||
"author_name": "${{ github.actor }}", | ||
"author_icon": "${{ github.event.sender.avatar_url }}", | ||
"fields": [ | ||
{ | ||
"title": "Repo URL", | ||
"value": "${{ github.event.repository.html_url }}" | ||
}, | ||
{ | ||
"title": "See Releases", | ||
"value": "${{ github.event.repository.html_url }}/releases" | ||
} | ||
] | ||
} | ||
] |
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