Skip to content

Commit

Permalink
QA-6145 updated yml for hq and api
Browse files Browse the repository at this point in the history
  • Loading branch information
kbo001 committed Feb 26, 2024
1 parent 31642c4 commit ec10102
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/hq-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ jobs:
receivers = '[email protected], [email protected], [email protected]'
}
let SLACK_WEBHOOK_URL =
return {
"subject": subject,
Expand Down Expand Up @@ -205,7 +204,7 @@ jobs:
- name: Post to Slack channel for Staging
id: slack_staging
uses: slackapi/[email protected]
if: ${{(github.event.client_payload.environment == 'staging') && failure() }}
if: ${{(github.event_name != 'repository_dispatch' && github.event.client_payload.environment == 'production') || (github.event.client_payload.environment == 'staging') && failure() }}
with:
payload: |
{
Expand Down
65 changes: 62 additions & 3 deletions .github/workflows/request_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,69 @@ jobs:
attachments: /home/runner/work/dimagi-qa/dimagi-qa/report_api_${{ matrix.environment }}.html
priority: normal

- name: Post to Slack channel on Failure
id: slack-api

- name: Post to Slack channel for Prod
id: slack-api-prod
uses: slackapi/[email protected]
if: failure()
if: ${{ (github.event_name == 'repository_dispatch') && (github.event.client_payload.environment == 'production') && always() }}
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": " Hola 👋 \n*${{ github.workflow }}* were just triggered!"
}
},
{
"type": "context",
"elements": [
{
"type": "mrkdwn",
"text": "*Environment: *\n ${{ matrix.environment }} \n"
},
{
"type": "mrkdwn",
"text": " "
},
{
"type": "mrkdwn",
"text": "*Status: *\n ${{ job.status }} :x:"
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Here's the corresponding workflow execution :arrow_right::arrow_right:"
},
"accessory": {
"type": "button",
"text": {
"type": "plain_text",
"text": "View on Github",
"emoji": true
},
"value": "click_me_123",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"action_id": "button-action",
"style": "danger"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_PROD_RESULTS }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK


- name: Post to Slack channel for Staging
id: slack-api-staging
uses: slackapi/[email protected]
if: ${{(github.event_name != 'repository_dispatch' && github.event.client_payload.environment == 'production') || (github.event.client_payload.environment == 'staging') && failure() }}
with:
payload: |
{
Expand Down

0 comments on commit ec10102

Please sign in to comment.