fix status
This commit is contained in:
26
action.yml
26
action.yml
@@ -5,6 +5,10 @@ inputs:
|
||||
description: "Text"
|
||||
required: false
|
||||
default: ''
|
||||
caption:
|
||||
description: "Text"
|
||||
required: false
|
||||
default: "<a href='${{ github.event.repository.html_url }}/actions/runs/${{ github.run_number }}'>%23${{ github.run_number }}</a> <b>${{ github.event.repository.name }}</b><br>"
|
||||
message_id:
|
||||
description: "Message ID"
|
||||
required: false
|
||||
@@ -20,7 +24,7 @@ inputs:
|
||||
status:
|
||||
description: "Status message"
|
||||
required: false
|
||||
default: 'true'
|
||||
default: ${{ job.status }}
|
||||
chat_id:
|
||||
description: "Chat ID"
|
||||
required: true
|
||||
@@ -52,24 +56,20 @@ runs:
|
||||
GITHUB_ACTION_PATH: ${{ github.action_path }}
|
||||
|
||||
- name: Send message
|
||||
# if: inputs.message != '' && status == ''
|
||||
run: |
|
||||
if [[ "${{ inputs.status }}" == "true" ]]; then
|
||||
if [[ "${{ job.status }}" == "success" ]]; then
|
||||
STATUS = ${{ inputs.status }}
|
||||
if [[ STATUS == "success" ]]; then
|
||||
STATUS="✅"
|
||||
elif [[ "${{ job.status }}" == "failure" ]]; then
|
||||
elif [[ STATUS == "failure" ]]; then
|
||||
STATUS="❌"
|
||||
elif [[ "${{ job.status }}" == "cancelled" ]]; then
|
||||
elif [[ STATUS == "cancelled" ]]; then
|
||||
STATUS="⚠️"
|
||||
else
|
||||
STATUS="🚀"
|
||||
fi
|
||||
caption="<a href='${{ github.event.repository.html_url }}/actions/runs/${{ github.run_number }}'>%23${{ github.run_number }}</a> <b>${{ github.event.repository.name }}</b>"
|
||||
STATUS="$STATUS caption\n"
|
||||
else
|
||||
STATUS=""
|
||||
if [[ STATUS != '' ]]; then
|
||||
STATUS="$STATUS "
|
||||
fi
|
||||
sendMessage "${{ inputs.bot_token }}" ${{ inputs.chat_id }} "$STATUS${{ inputs.message }}"
|
||||
CAPTION="$STATUS${{ inputs.caption }}"
|
||||
sendMessage "${{ inputs.bot_token }}" ${{ inputs.chat_id }} "$CAPTION${{ inputs.message }}"
|
||||
shell: bash
|
||||
|
||||
- name: Delete message
|
||||
|
||||
Reference in New Issue
Block a user