Compare commits
4 Commits
7356e38489
...
30764b992f
| Author | SHA1 | Date | |
|---|---|---|---|
| 30764b992f | |||
| e88e4ea301 | |||
| 1f046574b5 | |||
| a11bec63b9 |
@@ -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
|
||||||
Reference in New Issue
Block a user