-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DEVOPS-615] Added Slack notification.
- Loading branch information
Showing
1 changed file
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,7 +87,7 @@ jobs: | |
- | ||
name: Process codebase to run in CI | ||
run: | | ||
find . -name "docker-compose.yml" -print0 | xargs -0 -I {} sh -c "sed -i -e ''/###/d'' {} && sed -i -e ''s/##//'' {} && sed -i -e 's#- .:/app:delegated##' {}" | ||
find . -name "docker-compose.yml" -print0 | xargs -0 -I {} sh -c "sed -i -e ''/###/d'' {} && sed -i -e ''s/##//'' {} && sed -i -e 's#- .:/app:delegated#[]#' {}" | ||
mkdir -p /tmp/workspace/code | ||
- | ||
|
@@ -105,3 +105,66 @@ jobs: | |
name: Install GovCMS profile | ||
run: ahoy install | ||
|
||
- | ||
name: Notify failures to Slack | ||
if: failure() | ||
uses: slackapi/[email protected] | ||
with: | ||
# See https://github.com/slackapi/slack-github-action?tab=readme-ov-file | ||
channel-id: ${{ vars.SLACK_CHANNEL }} | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#ff0000", | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Scaffold test failure" | ||
} | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "A job was not successful, please view the pipeline and rerun." | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Project Type:*\${{ matrix.project_type }}" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*GovCMS Image:*\n${{ matrix.govcms_image }}" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "actions", | ||
"block_id": "view_pipeline", | ||
"elements": [ | ||
{ | ||
"type": "button", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "View pipeline" | ||
}, | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|