diff --git a/action.yml b/action.yml
index 8afe2b6..251657e 100644
--- a/action.yml
+++ b/action.yml
@@ -5,6 +5,10 @@ inputs:
description: "Text"
required: false
default: ''
+ caption:
+ description: "Text"
+ required: false
+ default: "%23${{ github.run_number }} ${{ github.event.repository.name }}
"
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="✅"
- elif [[ "${{ job.status }}" == "failure" ]]; then
- STATUS="❌"
- elif [[ "${{ job.status }}" == "cancelled" ]]; then
- STATUS="⚠️"
- else
- STATUS="🚀"
- fi
- caption="%23${{ github.run_number }} ${{ github.event.repository.name }}"
- STATUS="$STATUS caption\n"
- else
- STATUS=""
+ STATUS = ${{ inputs.status }}
+ if [[ STATUS == "success" ]]; then
+ STATUS="✅"
+ elif [[ STATUS == "failure" ]]; then
+ STATUS="❌"
+ elif [[ STATUS == "cancelled" ]]; then
+ STATUS="⚠️"
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
- name: Delete message