Skip to content

Commit

Permalink
do not fail slack notification if not all products run
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel committed Jun 12, 2024
1 parent 5a0e996 commit ecaa68b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/actions/notify-slack-jobs-result/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ runs:
]
| map("{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"<\(.html_url)|\(.cap)>: \(.conclusion)\"}}")
| join(",")')
if [ "$FORMATTED_RESULTS" = '""' ]; then
echo skipped=true >> $GITHUB_OUTPUT
FORMATTED_RESULTS="{\"type\": \"section\", \"text\": {\"type\": \"mrkdwn\", \"text\": \"No test run: :ballot_box_with_check:\"}}"
fi
echo "Formatted Results:"
echo $FORMATTED_RESULTS
Expand All @@ -91,13 +96,13 @@ runs:
"thread_ts": "${{ inputs.slack_thread_ts }}",
"attachments": [
{
"color": "${{ steps.test-results.outputs.all_success == 'true' && '#2E7D32' || '#C62828' }}",
"color": "${{ steps.test-results.outputs.all_success == 'true' && '#2E7D32' || steps.check-skipped.outputs.skipped == 'true' && '#7F7F7F' || '#C62828' }}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "${{ inputs.message_title }} ${{ steps.test-results.outputs.all_success == 'true' && ':white_check_mark:' || ':x:'}}",
"text": "${{ inputs.message_title }} ${{ steps.test-results.outputs.all_success == 'true' && ':white_check_mark:' || steps.check-skipped.outputs.skipped == 'true' && ':ballot_box_with_check:' || ':x:'}}",
"emoji": true
}
},
Expand All @@ -108,4 +113,4 @@ runs:
]
}
]
}
}

0 comments on commit ecaa68b

Please sign in to comment.