Skip to content

Commit

Permalink
Create color codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mondlicht1 committed Mar 12, 2024
1 parent c0945e4 commit dba2114
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions notify-slack/workflow-status/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ runs:
- name: Notify Slack Channel
shell: bash
run: |
color="warning"
if [ "${{ inputs.workflow-status }}" == "failed" ]; then
color="danger"
elif [ "${{ inputs.workflow-status }}" == "succeeded" ]; then
color="good"
fi
curl "${{ inputs.slack-webhook }}" -X POST -H "Content-Type: application/json" \
--data '{
"username": "${{ inputs.slack-username }}",
Expand All @@ -28,6 +34,7 @@ runs:
{
"title": "[${{ github.repository }}] ${{ github.workflow }} ${{ inputs.workflow-status }} on ${{ github.head_ref }}",
"text": "*<https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha || github.sha }}|Commit>* *<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Workflow>*",
"color": "$color"
}
]
}'

0 comments on commit dba2114

Please sign in to comment.