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