native variant

This commit is contained in:
2025-10-15 16:08:41 +03:00
parent 67647fb4dd
commit a11bec63b9

View File

@@ -36,36 +36,31 @@ runs:
*) echo "ICON=" >> $GITHUB_ENV ;; *) echo "ICON=" >> $GITHUB_ENV ;;
esac esac
- name: Notify VK Teams - name: Notify VK Teams (native)
uses: dosymep/vk-teams-action@v1.0.0 if: always()
shell: bash
continue-on-error: true continue-on-error: true
with:
token: ${{ env.token }}
to: ${{ env.to }}
format: MarkdownV2
message: |
*${{ github.repository }}* \- \[${{ inputs.name }}\]\(${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}\) \
was *${{ inputs.result }}* by ${{ github.event.sender.login }} ${{ env.ICON }}
- name: Wait a bit (ensure send completes)
if: always()
shell: bash
run: | run: |
echo "[DEBUG] Starting sleep to ensure message delivery..." echo "[DEBUG] Sending VK Teams notification..."
date JSON_PAYLOAD=$(jq -n \
sleep 5 --arg token "${{ env.token }}" \
echo "[DEBUG] Finished sleep, message should have been delivered." --arg to "${{ env.to }}" \
date --arg fmt "MarkdownV2" \
--arg msg "*${{ github.repository }}* - [${{ inputs.name }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}) was *${{ inputs.result }}* by ${{ github.event.sender.login }} ${{ env.ICON }}" \
'{token: $token, chatId: $to, parseMode: $fmt, text: $msg}')
- name: Force wait for container cleanup # Отправка запроса
if: always() curl -s -X POST "https://myteam.mail.ru/bot/v1/messages/sendText" \
shell: bash -H "Content-Type: application/json" \
run: | -d "$JSON_PAYLOAD"
echo "[DEBUG] Waiting for runner cleanup barrier..."
# пока Docker демон удаляет контейнер, удерживаем процесс активным CODE=$?
for i in {1..5}; do if [ $CODE -ne 0 ]; then
docker ps -a | grep act || break echo "[WARN] VK Teams notification failed with exit code $CODE"
echo "[DEBUG] Runner still cleaning up... $i" else
sleep 1 echo "[INFO] VK Teams notification sent successfully"
done fi
echo "[DEBUG] Cleanup done."
# Делаем паузу, чтобы убедиться, что сообщение дошло
echo "[DEBUG] Sleeping 5s to ensure delivery..."
sleep 5