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