send button only on success

This commit is contained in:
Kirill Chikalin
2025-06-02 07:05:22 +03:00
parent c1ed7f0629
commit 9a927d171b

View File

@@ -67,13 +67,16 @@ runs:
- name: Send message
run: |
button_url=${{ inputs.button_url }}
STATUS=${{ inputs.status }}
if [[ "$STATUS" == "success" ]]; then
STATUS="✅"
elif [[ "$STATUS" == "failure" ]]; then
STATUS="❌"
button_url=""
elif [[ "$STATUS" == "cancelled" ]]; then
STATUS="⚠️"
button_url=""
fi
if [[ "$STATUS" != '' ]]; then
STATUS="$STATUS "
@@ -82,7 +85,7 @@ runs:
CAPTION="$STATUS${{ inputs.caption }}"
echo $CAPTION
echo "$CAPTION${{ inputs.message }}"
sendMessage "${{ inputs.bot_token }}" ${{ inputs.chat_id }} "$CAPTION${{ inputs.message }}" "${{ inputs.button_title }}" "${{ inputs.button_url }}"
sendMessage "${{ inputs.bot_token }}" ${{ inputs.chat_id }} "$CAPTION${{ inputs.message }}" "${{ inputs.button_title }}" "$button_url"
shell: bash
- name: Delete message