-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Notify Launch developers slack when a version is released
- Loading branch information
Brent Hosie
committed
Apr 19, 2021
1 parent
586b891
commit a6c0141
Showing
1 changed file
with
47 additions
and
0 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" | ||
} | ||
] | ||
} | ||
] |