GHA: correct failed build message json

This commit is contained in:
aboyko
2023-11-01 14:40:02 -04:00
parent 0baf5113b2
commit 251399f83d
2 changed files with 26 additions and 37 deletions

View File

@@ -26,23 +26,12 @@ jobs:
{
"attachments": [
{
"text": "${{ inputs.label }} ${{ inputs.link }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ inputs.label }} ${{ inputs.link }}"
}
}
],
"pretext": "Build Failed",
"color": "f0190a",
"fields": [
{
"title": "Status",
"title": "${{ inputs.label }} ${{ inputs.link }}",
"short": true,
"value": "Completed"
"value": "Failed"
}
]
}

View File

@@ -4,32 +4,32 @@ on:
workflow_dispatch:
jobs:
slack-message:
name: Send slack message
runs-on: ubuntu-latest
steps:
- id: slack
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117
env:
SLACK_BOT_TOKEN: ${{ secrets.VMWARE_SLACK_BOT_TOKEN }}
with:
channel-id: "C0188MENU2J"
payload: |
{
"text": "Test message title `Version` is available now",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Test Message text `Version` is available now"
}
}
]
}
# slack-message:
# name: Send slack message
# runs-on: ubuntu-latest
# steps:
# - id: slack
# uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117
# env:
# SLACK_BOT_TOKEN: ${{ secrets.VMWARE_SLACK_BOT_TOKEN }}
# with:
# channel-id: "C0188MENU2J"
# payload: |
# {
# "text": "Test message title `Version` is available now",
# "blocks": [
# {
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": "Test Message text `Version` is available now"
# }
# }
# ]
# }
notify-failure:
needs: [ slack-message ]
# needs: [ slack-message ]
uses: ./.github/workflows/notify-failed-build.yml
with:
link: '[${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})'