chore(github): improve slack notification action (#9100)

This commit is contained in:
César Arroba
2025-10-30 15:32:14 +01:00
committed by GitHub
parent 1c906b37cd
commit 2740d73fe7

View File

@@ -12,7 +12,7 @@ inputs:
required: false
default: ''
step-outcome:
description: 'Outcome of a step to determine status (success/failure) - automatically sets STATUS_EMOJI and STATUS_TEXT env vars'
description: 'Outcome of a step to determine status (success/failure) - automatically sets STATUS_EMOJI, STATUS_TEXT, and STATUS_COLOR env vars'
required: false
default: ''
outputs:
@@ -23,16 +23,20 @@ runs:
using: 'composite'
steps:
- name: Determine status
if: inputs.step-outcome != ''
id: status
shell: bash
run: |
if [[ "${{ inputs.step-outcome }}" == "success" ]]; then
echo "STATUS_EMOJI=[✓]" >> $GITHUB_ENV
echo "STATUS_TEXT=completed successfully!" >> $GITHUB_ENV
else
echo "STATUS_TEXT=succeeded" >> $GITHUB_ENV
echo "STATUS_COLOR=6aa84f" >> $GITHUB_ENV
elif [[ "${{ inputs.step-outcome }}" == "failure" ]]; then
echo "STATUS_EMOJI=[✗]" >> $GITHUB_ENV
echo "STATUS_TEXT=failed" >> $GITHUB_ENV
echo "STATUS_COLOR=fc3434" >> $GITHUB_ENV
else
# No outcome provided - pending/in progress state
echo "STATUS_COLOR=dbab09" >> $GITHUB_ENV
fi
- name: Send Slack notification (new message)
@@ -62,4 +66,3 @@ runs:
else
echo "ts=${{ inputs.update-ts }}" >> $GITHUB_OUTPUT
fi