Skip to content

Commit 310891f

Browse files
christinewangcwtkucar
authored and
tkucar
committed
chore(ci): [CG-10689] add slack alert in release (#316)
# Motivation <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> # Testing <!-- How was the change tested? --> # Please check the following before marking your PR as ready for review - [ ] I have added tests for my changes - [ ] I have updated the documentation or added new documentation as needed
1 parent c7b4401 commit 310891f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,25 @@ jobs:
9090
uv publish --publish-url https://upload.pypi.org/legacy/
9191
9292
- name: Make github release
93+
id: github-release
9394
uses: softprops/action-gh-release@v2
9495
with:
9596
files: dist/*
9697
fail_on_unmatched_files: true
9798
generate_release_notes: true
99+
100+
- uses: slackapi/[email protected]
101+
if: always()
102+
with:
103+
method: chat.postMessage
104+
token: ${{ secrets.SLACK_BOT_TOKEN }}
105+
payload: |
106+
username: ${{ job.status == 'success' && format('Released <{0}|{1}>', steps.github-release.outputs.url, github.ref_name) || format('Failed to release {0}', github.ref_name) }}
107+
channel: "#release"
108+
icon_emoji: "${{ job.status == 'success' && ':white_check_mark:' || ':x:' }}"
109+
text: |
110+
Actor: `${{ github.triggering_actor }}`
111+
Author: `${{ github.event.head_commit.author.username }}`
112+
${{ format('Commit: <{0}/{1}/commit/{2}|{1}@{2[:7]}>', github.server_url, github.repository, github.sha) || ''}}
113+
${{ format('Description: `{0}`', github.event.head_commit.message) || ''}}
114+
View <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GHA logs>

0 commit comments

Comments
 (0)