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

chore(ci): update slack message #204

Merged
merged 7 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
96 changes: 94 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,53 @@ jobs:
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFY_PUBLIC_SHARED_ACTIONS }}
status: success
success-message: ":white_check_mark: ${{ github.workflow }} workflow successfully ran within ${{ github.repository }}"
payload: |
{
"text": "Completely custom Slack message for CI",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"emoji": true,
"text": "CI Workflow Success"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:*\n<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n<${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.ref_name }}>"
},
{
"type": "mrkdwn",
"text": "*Workflow Run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_number }}>"
},
{
"type": "mrkdwn",
"text": "*TriggeredByCommit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ steps.slack-variables.outputs.short-commit-hash }}>"
},
{
"type": "mrkdwn",
"text": "*Triggered By:*\n${{ github.actor }}"
},
{
"type": "mrkdwn",
"text": "*Commit Author:*\n${{ github.event.head_commit.author.name }}"
},
{
"type": "mrkdwn",
"text": "*Event Name:*\n${{ github.event_name }}"
}
]
}
]
}

# Failure Notification
- name: Send Failure Slack alert
Expand All @@ -68,4 +114,50 @@ jobs:
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_ALERT_PUBLIC_SHARED_ACTIONS }}
status: failure
failure-message: ":x: This is a *failure* notification from ${{ github.repository }} for workflow ${{ github.workflow }}"
payload: |
{
"text": "Completely custom Slack message for CI",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"emoji": true,
"text": "CI Workflow Failure"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:*\n<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n<${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.ref_name }}>"
},
{
"type": "mrkdwn",
"text": "*Workflow Run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_number }}>"
},
{
"type": "mrkdwn",
"text": "*TriggeredByCommit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ steps.slack-variables.outputs.short-commit-hash }}>"
},
{
"type": "mrkdwn",
"text": "*Triggered By:*\n${{ github.actor }}"
},
{
"type": "mrkdwn",
"text": "*Commit Author:*\n${{ github.event.head_commit.author.name }}"
},
{
"type": "mrkdwn",
"text": "*Event Name:*\n${{ github.event_name }}"
}
]
}
]
}
96 changes: 94 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,53 @@ jobs:
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFY_PUBLIC_SHARED_ACTIONS }}
status: success
success-message: ":white_check_mark: ${{ github.workflow }} workflow successfully ran within ${{ github.repository }}"
payload: |
{
"text": "Completely custom Slack message for release",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"emoji": true,
"text": "Release Workflow Success"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:*\n<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n<${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.ref_name }}>"
},
{
"type": "mrkdwn",
"text": "*Workflow Run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_number }}>"
},
{
"type": "mrkdwn",
"text": "*TriggeredByCommit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
pankajmouriyakong marked this conversation as resolved.
Show resolved Hide resolved
"text": "*Release Commit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ needs.release.outputs.release_commit }}|${{ needs.release.outputs.release_commit }}>"
},
{
"type": "mrkdwn",
"text": "*Triggered By:*\n${{ github.actor }}"
},
{
"type": "mrkdwn",
"text": "*Event Name:*\n${{ github.event_name }}"
}
]
}
]
}

# Failure Notification
- name: Send Failure Notification
Expand All @@ -86,4 +132,50 @@ jobs:
with:
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_ALERT_PUBLIC_SHARED_ACTIONS }}
status: failure
failure-message: ":x: This is a *failure* notification from ${{ github.repository }} for workflow ${{ github.workflow }}"
payload: |
{
"text": "Completely custom Slack message for release",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"emoji": true,
"text": "Release Workflow Failure"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Repository:*\n<${{ github.server_url }}/${{ github.repository }}|${{ github.repository }}>"
},
{
"type": "mrkdwn",
"text": "*Branch:*\n<${{ github.server_url }}/${{ github.repository }}/tree/${{ github.ref_name }}|${{ github.ref_name }}>"
},
{
"type": "mrkdwn",
"text": "*Workflow Run:*\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|${{ github.run_number }}>"
},
{
"type": "mrkdwn",
"text": "*TriggeredByCommit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
},
{
"type": "mrkdwn",
"text": "*Release Commit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ needs.release.outputs.release_commit }}|${{ needs.release.outputs.release_commit }}>"
},
{
"type": "mrkdwn",
"text": "*Triggered By:*\n${{ github.actor }}"
},
{
"type": "mrkdwn",
"text": "*Event Name:*\n${{ github.event_name }}"
}
]
}
]
}
Loading