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

ci(slackbot): clean up slack alerts #1272

Merged
merged 11 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
66 changes: 44 additions & 22 deletions .github/slack-templates/pipeline-failed.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,47 @@
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*:rotating_light: Pipeline failing for *${{ env.ENVIRONMENT }}* :rotating_light:*\n\nPlease check the workflow for more details."
}
},
{ "type": "divider" },
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Run"
},
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
"attachments": [
{
"color": "#FF0000",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "Github pipeline failing",
"emoji": true
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Environment:* ${{ env.ENVIRONMENT }}"
}
]
}
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Please check the workflow for more details."
}
},
{
"type": "divider"
},
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Run"
},
"url": "${{ env.RUN_URL }}"
}
]
}
]
}
]
}
36 changes: 0 additions & 36 deletions .github/workflows/action-run-k6-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ on:
required: true
TOKEN_GENERATOR_PASSWORD:
required: true
SLACK_BOT_TOKEN:
required: true

jobs:
k6-test:
Expand Down Expand Up @@ -57,37 +55,3 @@ jobs:
action_fail: true
files: |
junit.xml

- name: Send Slack message on K6 test failure
if: always() && failure()
uses: slackapi/[email protected]
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID_FOR_K6_TESTS }}
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*:rotating_light: K6 Tests Failed for environment *${{ inputs.environment }}* :rotating_light:*\n\nPlease check the workflow for more details."
}
},
{ "type": "divider" },
{
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "View Run"
},
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ jobs:
secrets:
TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }}
TOKEN_GENERATOR_PASSWORD: ${{ secrets.TOKEN_GENERATOR_PASSWORD }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
environment: test
apiVersion: v1
Expand All @@ -164,6 +163,7 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
ENVIRONMENT: test
RUN_URL: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID_FOR_RELEASES }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ jobs:
# secrets:
# TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }}
# TOKEN_GENERATOR_PASSWORD: ${{ secrets.TOKEN_GENERATOR_PASSWORD }}
# SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
# with:
# environment: prod
# apiVersion: v1
Expand All @@ -149,6 +148,7 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
ENVIRONMENT: prod
RUN_URL: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID_FOR_RELEASES }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ jobs:
secrets:
TOKEN_GENERATOR_USERNAME: ${{ secrets.TOKEN_GENERATOR_USERNAME }}
TOKEN_GENERATOR_PASSWORD: ${{ secrets.TOKEN_GENERATOR_PASSWORD }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
environment: staging
apiVersion: v1
Expand All @@ -128,6 +127,7 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
arealmaas marked this conversation as resolved.
Show resolved Hide resolved
ENVIRONMENT: staging
RUN_URL: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID_FOR_RELEASES }}
Expand Down
Loading