-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1151 from RasaHQ/INFRA-1116
[INFRA-1116] Slack notifications improvement
- Loading branch information
Showing
1 changed file
with
30 additions
and
16 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 |
---|---|---|
|
@@ -139,24 +139,38 @@ jobs: | |
pip install -U github3.py pep440_version_utils | ||
python3 ${GITHUB_WORKSPACE}/scripts/publish_gh_release_notes.py | ||
- name: Get RASA SDK Version | ||
env: | ||
RASA_SDK_VERSION: ${{ github.ref }} | ||
release-artifact-slack-notifications: | ||
name: Release Analytics Artifact Slack Notifications | ||
runs-on: ubuntu-22.04 | ||
needs: [build_docker_image, deploy] | ||
if: always() # Ensures this job runs regardless of the result of previous jobs | ||
|
||
steps: | ||
- name: Set tag version | ||
run: | | ||
echo "RASA_SDK_VERSION=${RASA_SDK_VERSION/refs\/tags\//}" >> $GITHUB_ENV | ||
if [[ "$GITHUB_REF" == refs/tags/* ]]; then | ||
echo "TAG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
else | ||
echo "No tag version found." | ||
exit 1 | ||
fi | ||
- name: Notify Slack 💬 | ||
if: success() | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ASSISTANT_RELEASE_WEBHOOK }} | ||
uses: Ilshidur/[email protected] | ||
- name: Notify Slack of successful release 💬 | ||
if: ${{ needs.build_docker_image.result == 'success' && needs.deploy.result == 'success' }} | ||
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 #v 1.25.0 | ||
with: | ||
args: "⚡ New *Rasa SDK* version ${{ env.RASA_SDK_VERSION }} has been released! Changelog: https://github.com/RasaHQ/rasa-sdk/blob/${{ env.RASA_SDK_VERSION }}/CHANGELOG.mdx" | ||
|
||
- name: Notify Slack of Failure ⛔ | ||
if: failure() | ||
# Send notification to #release slack channel | ||
channel-id: "C024Z61K9QU" | ||
slack-message: ":rocket: New *Rasa SDKe* version `${{ env.TAG_VERSION }}` has been released! More information can be found <https://github.com/RasaHQ/rasa-sdk/releases/tag/${{ env.TAG_VERSION }}|here>." | ||
env: | ||
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ASSISTANT_DEV_TRIBE_WEBHOOK }} | ||
uses: Ilshidur/[email protected] | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
- name: Notify Slack of unsuccessful release ⛔️ | ||
if: ${{ needs.build_docker_image.result != 'success' || needs.deploy.result != 'success' }} | ||
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 #v 1.25.0 | ||
with: | ||
args: "⛔️ *Rasa SDK* version ${{ env.RASA_SDK_VERSION }} could not be released 😱 GitHub Actions: https://github.com/RasaHQ/rasa-sdk/actions?query=branch%3A${{ env.RASA_SDK_VERSION }}" | ||
# Send notification to #devtribe slack channel | ||
channel-id: "C061J0LGHU0" | ||
slack-message: ":broken_heart: *Rasa SDKe* release version `${{ env.TAG_VERSION }}` has failed! More information can be found <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>." | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |