-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to slack notifications (#481)
* Migrate to slack notifications Migrate away from Discord and to Slack notifications Notifications are going to #mondoo-ops via the Mondoo App Signed-off-by: Philip Balinov <[email protected]> * Cleanup slack step a bit --------- Signed-off-by: Philip Balinov <[email protected]>
- Loading branch information
1 parent
f0115bf
commit a230a31
Showing
2 changed files
with
126 additions
and
13 deletions.
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 |
---|---|---|
|
@@ -8,11 +8,45 @@ on: | |
jobs: | ||
check_gpg: | ||
name: Check Mondoo's GPG key has not expired | ||
env: | ||
# C07R9GSGKEU == #mondoo-ops | ||
SLACK_BOT_CHANNEL_ID: "C07R9GSGKEU" | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ env.SLACK_BOT_CHANNEL_ID }} | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#FFFF00", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "<${{ github.event.workflow_run.html_url }}|${{ github.event.workflow_run.name }}>" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Status:*\n`In Progress`" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
- name: Install Mondoo cnspec | ||
shell: bash | ||
run: | | ||
|
@@ -32,11 +66,34 @@ jobs: | |
shell: bash | ||
run: | | ||
bash test/scripts/cert-harmony.sh | ||
- name: Discord notification | ||
uses: Ilshidur/[email protected] | ||
if: failure() | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
- uses: slackapi/[email protected] | ||
if: always() | ||
with: | ||
args: ':warning: Mondoo GPG key is expiring or out of sync! (https://github.com/mondoohq/installer/actions/workflows/check_gpg_key_not_expired.yml)' | ||
channel-id: ${{ env.SLACK_BOT_CHANNEL_ID }} | ||
update-ts: ${{ steps.slack.outputs.ts }} | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "${{ job.status == 'success' && '#00FF00' || job.status == 'failure' && '#FF0000' || '#FFA500' }}", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "<${{ github.event.workflow_run.html_url }}|${{ github.event.workflow_run.name }}>" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Status:*\n`${{ job.status }}`" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
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 |
---|---|---|
|
@@ -15,6 +15,9 @@ on: | |
jobs: | ||
build_container: | ||
runs-on: ubuntu-latest | ||
env: | ||
# C07R9GSGKEU == #mondoo-ops | ||
SLACK_BOT_CHANNEL_ID: "C07R9GSGKEU" | ||
timeout-minutes: 10 | ||
strategy: | ||
matrix: | ||
|
@@ -33,6 +36,36 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ env.SLACK_BOT_CHANNEL_ID }} | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "#FFFF00", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "<${{ github.event.workflow_run.html_url }}|${{ github.event.workflow_run.name }}>" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Status:*\n`In Progress`" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
with: | ||
|
@@ -51,10 +84,33 @@ jobs: | |
tags: | | ||
mondoohq/mondoo-install-test:${{ matrix.dockerfile }} | ||
- name: Discord notification | ||
uses: Ilshidur/[email protected] | ||
if: failure() | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
- uses: slackapi/[email protected] | ||
if: always() | ||
with: | ||
args: ':warning: Mondoo install failed in test container! (https://github.com/mondoohq/installer/actions/workflows/test_with_container_build.yml)' | ||
channel-id: ${{ env.SLACK_BOT_CHANNEL_ID }} | ||
update-ts: ${{ steps.slack.outputs.ts }} | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "${{ job.status == 'success' && '#00FF00' || job.status == 'failure' && '#FF0000' || '#FFA500' }}", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "<${{ github.event.workflow_run.html_url }}|${{ github.event.workflow_run.name }}>" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Status:*\n`${{ job.status }}`" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |