diff --git a/action.yml b/action.yml index 7fd736e..283e291 100644 --- a/action.yml +++ b/action.yml @@ -4,10 +4,6 @@ inputs: message: description: "Text" required: false - default: "%23${{ github.run_number }} ${{ github.event.repository.name }}" - prefix: - description: "Message prefix" - required: false default: '' message_id: description: "Message ID" @@ -24,7 +20,7 @@ inputs: status: description: "Status message" required: false - default: '' + default: 'false' chat_id: description: "Chat ID" required: true @@ -56,8 +52,24 @@ runs: GITHUB_ACTION_PATH: ${{ github.action_path }} - name: Send message - if: inputs.message != '' && status == '' - run: sendMessage "${{ inputs.bot_token }}" ${{ inputs.chat_id }} "${{inputs.prefix}}${{ inputs.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="" + fi + sendMessage "${{ inputs.bot_token }}" ${{ inputs.chat_id }} "$STATUS${{ inputs.message }}" shell: bash - name: Delete message @@ -65,17 +77,17 @@ runs: run: deleteMessage "${{ inputs.bot_token }}" ${{ inputs.chat_id }} ${{ inputs.delete }} shell: bash - - name: Send job status - if: inputs.status != '' - run: | - if [[ "${{ job.status }}" == "success" ]]; then - STATUS="✅" - elif [[ "${{ job.status }}" == "failure" ]]; then - STATUS="❌" - elif [[ "${{ job.status }}" == "cancelled" ]]; then - STATUS="⚠️" - else - STATUS="❓" - fi - sendMessage "${{ inputs.bot_token }}" ${{ inputs.chat_id }} "$STATUS ${{ inputs.status }}" - shell: bash \ No newline at end of file +# - name: Send job status +# if: inputs.status != '' +# run: | +# if [[ "${{ job.status }}" == "success" ]]; then +# STATUS="✅" +# elif [[ "${{ job.status }}" == "failure" ]]; then +# STATUS="❌" +# elif [[ "${{ job.status }}" == "cancelled" ]]; then +# STATUS="⚠️" +# else +# STATUS="❓" +# fi +# sendMessage "${{ inputs.bot_token }}" ${{ inputs.chat_id }} "$STATUS ${{ inputs.status }}" +# shell: bash \ No newline at end of file