diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 45fb64a..56953cc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -179,74 +179,74 @@ jobs: ./scripts/deploy.sh -g -t ${target_stage} -v ${target_version} -r "${{ associated_record }}" # probably need to account for -x, --dry-run at some point. lets see how things go. - notify-teams-finish: - runs-on: ubuntu-latest - needs: [ configure, deploy ] - steps: - - name: Notify Teams of Deployment Completion - if: always() # This step runs regardless of success or failure - run: | - deploy_result="${{ needs.deploy.result }}" - deploy_status="Failed" - associated_record="${{ github.event.inputs.associated-record }}" - target_stage="${{ github.event.inputs.target-stage }}" + notify-teams-finish: + runs-on: ubuntu-latest + needs: [ configure, deploy ] + steps: + - name: Notify Teams of Deployment Completion + if: always() # This step runs regardless of success or failure + run: | + deploy_result="${{ needs.deploy.result }}" + deploy_status="Failed" + associated_record="${{ github.event.inputs.associated-record }}" + target_stage="${{ github.event.inputs.target-stage }}" - if [ "$deploy_result" == "success" ]; then - deploy_status="Succeeded" - fi + if [ "$deploy_result" == "success" ]; then + deploy_status="Succeeded" + fi - # Determine associated record value based on target stage and input - if [ -z "$associated_record" ]; then - if [ "$target_stage" != "prod" ]; then - associated_record="Not required (deployment to $target_stage)" - else - associated_record="Missing (required for production)" - fi + # Determine associated record value based on target stage and input + if [ -z "$associated_record" ]; then + if [ "$target_stage" != "prod" ]; then + associated_record="Not required (deployment to $target_stage)" + else + associated_record="Missing (required for production)" fi + fi - curl -H "Content-Type: application/json" \ - -d '{ - "type": "message", - "attachments": [ - { - "contentType": "application/vnd.microsoft.card.adaptive", - "content": { - "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", - "type": "AdaptiveCard", - "version": "1.4", - "body": [ - { - "type": "TextBlock", - "size": "Large", - "weight": "Bolder", - "text": "UW Directory - Deployment Notification" - }, - { - "type": "TextBlock", - "text": "Deployment to stage **${{ github.event.inputs.target-stage }}** has **'"$deploy_status"'**.", - "wrap": true - }, - { - "type": "FactSet", - "facts": [ - {"title": "Stage:", "value": "${{ github.event.inputs.target-stage }}"}, - {"title": "Version:", "value": "${{ needs.configure.outputs.target-version }}"}, - {"title": "Associated Record:", "value": "'"${associated_record}"'"}, - {"title": "Initiated By:", "value": "${{ github.actor }}"}, - {"title": "Status:", "value": "'"$deploy_status"'"} - ] - } - ], - "actions": [ - { - "type": "Action.OpenUrl", - "title": "View Workflow", - "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } - ] - } + curl -H "Content-Type: application/json" \ + -d '{ + "type": "message", + "attachments": [ + { + "contentType": "application/vnd.microsoft.card.adaptive", + "content": { + "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", + "type": "AdaptiveCard", + "version": "1.4", + "body": [ + { + "type": "TextBlock", + "size": "Large", + "weight": "Bolder", + "text": "UW Directory - Deployment Notification" + }, + { + "type": "TextBlock", + "text": "Deployment to stage **${{ github.event.inputs.target-stage }}** has **'"$deploy_status"'**.", + "wrap": true + }, + { + "type": "FactSet", + "facts": [ + {"title": "Stage:", "value": "${{ github.event.inputs.target-stage }}"}, + {"title": "Version:", "value": "${{ needs.configure.outputs.target-version }}"}, + {"title": "Associated Record:", "value": "'"${associated_record}"'"}, + {"title": "Initiated By:", "value": "${{ github.actor }}"}, + {"title": "Status:", "value": "'"$deploy_status"'"} + ] + } + ], + "actions": [ + { + "type": "Action.OpenUrl", + "title": "View Workflow", + "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + ] } - ] - }' \ - "${{ env.IDENTITY_UW_DEPLOY_MS_TEAMS_WEBHOOK_URL }}" + } + ] + }' \ + "${{ env.IDENTITY_UW_DEPLOY_MS_TEAMS_WEBHOOK_URL }}"