4040 environment : ${{ inputs.environment }}
4141 sandbox : ${{ inputs.sandbox }}
4242 secrets :
43- AWS_ASSUME_ROLE : ${{ secrets.AWS_ASSUME_ROLE }}
44-
45- notify-slack :
46- runs-on : ubuntu-latest
47- environment : ${{ inputs.environment }}
48- needs : [services-e2etest, services-fhir-api-e2etest]
49- if : always()
50- steps :
51- - name : Configure AWS Credentials
52- uses : aws-actions/configure-aws-credentials@v5
53- with :
54- role-to-assume : ${{ secrets.AWS_ASSUME_ROLE }}
55- role-skip-session-tagging : true
56- aws-region : ${{ vars.AWS_REGION }}
57- mask-aws-account-id : true
58-
59- - name : Get SSM parameters from SSM
60- id : ssm-parameters
61- run : |
62- slack_bot_token=$(aws ssm get-parameter --name "/ndr/alerting/slack/bot_token" --with-decryption --query "Parameter.Value" --output text)
63- echo "::add-mask::$slack_bot_token"
64- echo "SLACK_BOT_TOKEN=$slack_bot_token" >> $GITHUB_ENV
65- - name : Send Slack Notification
66- 67- with :
68- method : chat.postMessage
69- token : ${{ env.SLACK_BOT_TOKEN }}
70- payload : |
71- {
72- "channel": "${{ vars.ALERTS_SLACK_CHANNEL_ID }}",
73- "attachments": [
74- {
75- "color": "${{ (needs.services-e2etest.result == 'success' && needs.services-fhir-api-e2etest.result == 'success') && '#36a64f' || '#ff0000' }}",
76- "blocks": [
77- {
78- "type": "header",
79- "text": {
80- "type": "plain_text",
81- "text": "${{ (needs.services-e2etest.result == 'success' && needs.services-fhir-api-e2etest.result == 'success') && '✅ Workflow SANDBOX: E2e Tests Backend succeeded' || '❌ Workflow SANDBOX: E2e Tests Backend failed' }}"
82- }
83- },
84- {
85- "type": "section",
86- "text": {
87- "type": "mrkdwn",
88- "text": "*Triggered by:* `${{ github.actor }}`\n*Branch:* `${{ github.event.pull_request.head.ref || github.ref_name }}`\n*Workflow:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.workflow }}>"
89- }
90- },
91- {
92- "type": "divider"
93- },
94- {
95- "type": "section",
96- "fields": [
97- {
98- "type": "mrkdwn",
99- "text": "*services-e2etest:* ${{ needs.services-e2etest.result == 'success' && ':white_check_mark:' || ':x:' }}"
100- },
101- {
102- "type": "mrkdwn",
103- "text": "*services-fhir-api-e2etest:* ${{ needs.services-fhir-api-e2etest.result == 'success' && ':white_check_mark:' || ':x:' }}"
104- }
105- ]
106- },
107- {
108- "type": "context",
109- "elements": [
110- {
111- "type": "mrkdwn",
112- "text": "Environment: `${{ inputs.environment }}` | Sandbox: `${{ inputs.sandbox }}`"
113- }
114- ]
115- }
116- ]
117- }
118- ]
119- }
43+ AWS_ASSUME_ROLE : ${{ secrets.AWS_ASSUME_ROLE }}
0 commit comments