Skip to content

Commit

Permalink
[DEVOPS-615] Added Slack notification.
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnykt committed Sep 3, 2024
1 parent b3991b4 commit 0871361
Showing 1 changed file with 64 additions and 1 deletion.
65 changes: 64 additions & 1 deletion .github/workflows/test-scaffold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
-
Expand All @@ -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 }}

0 comments on commit 0871361

Please sign in to comment.