Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add slack´s notification for not succeed executions #141

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
build_multiarch:
runs-on: ubuntu-22.04
needs: [ shellcheck ]
if: github.ref == 'refs/heads/master'
strategy:
matrix:
dist: [buster, bullseye]
Expand Down Expand Up @@ -82,3 +83,43 @@ jobs:
- name: Push Manifests
run: |
DISTS="buster bullseye latest" bash pushmanifest

# If the CI Pipeline does not succeed we should notify the interested agents
slack-notif:
runs-on: ubuntu-22.04
needs: [ build_multiarch, deploy_manifests ]
if: always()
name: Notify unsuccessful CI run
steps:
- name: Notify in Slack channel
if: always()
uses: slackapi/[email protected]
with:
channel-id: C04E3CL1WP7
payload: |
{
"attachments": [
{
"color": "#CC0000",
"fallback": "Unsuccessful bitnami/minideb CI pipeline",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Unsuccessful `bitnami/minideb` CI pipeline*"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "The CI pipeline for <${{ github.event.head_commit.url }}|bitnami/minideb@${{ github.event.head_commit.id }}> did not succeed. Check the related <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|action run> for more information."
}
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.CD_SLACK_BOT_TOKEN }}