From eccc9fcc1146c1c4e1a773670ebe2e3880c91c1c Mon Sep 17 00:00:00 2001 From: Kirill Chikalin Date: Thu, 20 Mar 2025 10:18:48 +0300 Subject: [PATCH] fix status --- action.yml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) 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