diff --git a/.github/actions/notify-slack-jobs-result/action.yml b/.github/actions/notify-slack-jobs-result/action.yml index f5df87bb909..bd6e3d8dfa3 100644 --- a/.github/actions/notify-slack-jobs-result/action.yml +++ b/.github/actions/notify-slack-jobs-result/action.yml @@ -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 @@ -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 } }, @@ -108,4 +113,4 @@ runs: ] } ] - } + }