Skip to content

Commit

Permalink
chore: add slack success message for release (#436)
Browse files Browse the repository at this point in the history
Send alert to the analytics-bot slack channel if release is successful.
Also, both the success and failure bot messages will include the app version in the message.
  • Loading branch information
jenniferarnesen authored Sep 15, 2023
1 parent 05d3d79 commit 054f61e
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,66 @@ jobs:
!cancelled() &&
github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Extract version
id: extract_version
uses: Saionaro/[email protected]

- name: Send failure message to analytics-internal-bot slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
slack-message: ':small_red_triangle_down: Line-listing-app release <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure>'
payload: |
{
"text": ":small_red_triangle_down: :line-listing-app: Line Listing version ${{ steps.extract_version.outputs.version }} release <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":small_red_triangle_down: :line-listing-app: Line Listing version ${{ steps.extract_version.outputs.version }} release <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

report-release-success:
runs-on: ubuntu-latest
needs: release
if: |
success() &&
!cancelled() &&
github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@master

- name: Extract version
id: extract_version
uses: Saionaro/[email protected]

- name: Send success message to analytics-internal-bot slack channel
id: slack
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"text": ":large_green_circle: :line-listing-app: :tada: Line Listing release succeeded for version: ${{ steps.extract_version.outputs.version }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":large_green_circle: :line-listing-app: :tada: Line Listing version ${{ steps.extract_version.outputs.version }} released <https://github.com/dhis2/line-listing-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Asuccess|successfully>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 comments on commit 054f61e

Please sign in to comment.