Skip to content

Commit

Permalink
chore: add slack bot release success message
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Jan 22, 2024
1 parent 2966187 commit 0f5199a
Showing 1 changed file with 60 additions and 2 deletions.
62 changes: 60 additions & 2 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
REPORTPORTAL_PROJECT: ${{ vars.REPORTPORTAL_PROJECT }}

call-workflow-e2e-prod:
if: "!contains(github.event.head_commit.message, '[skip ci]')"
needs: [build, lint, test]
uses: dhis2/workflows/.github/workflows/analytics-e2e-tests-prod.yml@master
secrets:
Expand Down Expand Up @@ -133,13 +134,70 @@ jobs:
if: |
failure() &&
!cancelled() &&
github.ref == 'refs/heads/master'
github.ref == 'refs/heads/master' &&
contains(github.event.head_commit.message, 'chore(release)')
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: Data-visualizer-app release <https://github.com/dhis2/data-visualizer-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure>'
payload: |
{
"text": ":small_red_triangle_down: :data-visualizer-app: DV release <https://github.com/dhis2/data-visualizer-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":small_red_triangle_down: :data-visualizer-app: DV release <https://github.com/dhis2/maps-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' &&
contains(github.event.head_commit.message, 'chore(release)')
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: :data-visualizer-app: :tada: DV app release succeeded for version: ${{ steps.extract_version.outputs.version }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":large_green_circle: :data-visualizer-app: :tada: DV version ${{ steps.extract_version.outputs.version }} released <https://github.com/dhis2/data-visualizer-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 0f5199a

Please sign in to comment.