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 - name: Send message
run: | run: |
button_url=${{ inputs.button_url }}
STATUS=${{ inputs.status }} STATUS=${{ inputs.status }}
if [[ "$STATUS" == "success" ]]; then if [[ "$STATUS" == "success" ]]; then
STATUS="✅" STATUS="✅"
elif [[ "$STATUS" == "failure" ]]; then elif [[ "$STATUS" == "failure" ]]; then
STATUS="❌" STATUS="❌"
button_url=""
elif [[ "$STATUS" == "cancelled" ]]; then elif [[ "$STATUS" == "cancelled" ]]; then
STATUS="⚠️" STATUS="⚠️"
button_url=""
fi fi
if [[ "$STATUS" != '' ]]; then if [[ "$STATUS" != '' ]]; then
STATUS="$STATUS " STATUS="$STATUS "
@@ -82,7 +85,7 @@ runs:
CAPTION="$STATUS${{ inputs.caption }}" CAPTION="$STATUS${{ inputs.caption }}"
echo $CAPTION echo $CAPTION
echo "$CAPTION${{ inputs.message }}" 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 shell: bash
- name: Delete message - name: Delete message