Skip to content

Commit

Permalink
Merge pull request #1151 from RasaHQ/INFRA-1116
Browse files Browse the repository at this point in the history
[INFRA-1116] Slack notifications improvement
  • Loading branch information
rasa-aadlv authored Nov 27, 2024
2 parents e957d83 + 40346d8 commit fe817e7
Showing 1 changed file with 30 additions and 16 deletions.
46 changes: 30 additions & 16 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit fe817e7

Please sign in to comment.