diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 97de422..39bc1fc 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -63,6 +63,7 @@ jobs: - name: Telegram notify (lint failed) if: failure() + continue-on-error: true run: | set -euo pipefail if [ -z "${TG_BOT_KEY:-}" ] || [ -z "${TG_CHANNEL:-}" ]; then @@ -78,9 +79,16 @@ jobs: actor=${GITHUB_ACTOR} commit=${COMMIT_MESSAGE}" - curl -fsS -X POST "https://api.telegram.org/bot${TG_BOT_KEY}/sendMessage" \ + curl -fsS \ + --connect-timeout 5 \ + --max-time 15 \ + --retry 2 \ + --retry-delay 2 \ + --retry-all-errors \ + -X POST "https://api.telegram.org/bot${TG_BOT_KEY}/sendMessage" \ -d "chat_id=${TG_CHANNEL}" \ - --data-urlencode "text=${MSG}" + --data-urlencode "text=${MSG}" \ + || echo "Telegram notification failed; continue pipeline" test: name: Run Tests @@ -128,6 +136,7 @@ jobs: - name: Telegram notify (test failed) if: failure() + continue-on-error: true run: | set -euo pipefail if [ -z "${TG_BOT_KEY:-}" ] || [ -z "${TG_CHANNEL:-}" ]; then @@ -143,13 +152,21 @@ jobs: actor=${GITHUB_ACTOR} commit=${COMMIT_MESSAGE}" - curl -fsS -X POST "https://api.telegram.org/bot${TG_BOT_KEY}/sendMessage" \ + curl -fsS \ + --connect-timeout 5 \ + --max-time 15 \ + --retry 2 \ + --retry-delay 2 \ + --retry-all-errors \ + -X POST "https://api.telegram.org/bot${TG_BOT_KEY}/sendMessage" \ -d "chat_id=${TG_CHANNEL}" \ - --data-urlencode "text=${MSG}" + --data-urlencode "text=${MSG}" \ + || echo "Telegram notification failed; continue pipeline" notify_success: name: Telegram Notify Success runs-on: ubuntu-latest + timeout-minutes: 1 needs: [lint, test] if: | always() && @@ -160,6 +177,7 @@ jobs: TG_CHANNEL: ${{ secrets.TG_CHANNEL }} steps: - name: Telegram notify (lint+test success) + continue-on-error: true env: COMMIT_MESSAGE: ${{ github.event.head_commit.message }} run: | @@ -175,6 +193,13 @@ jobs: actor=${GITHUB_ACTOR} commit=${COMMIT_MESSAGE:-n/a}" - curl -fsS -X POST "https://api.telegram.org/bot${TG_BOT_KEY}/sendMessage" \ + curl -fsS \ + --connect-timeout 5 \ + --max-time 15 \ + --retry 2 \ + --retry-delay 2 \ + --retry-all-errors \ + -X POST "https://api.telegram.org/bot${TG_BOT_KEY}/sendMessage" \ -d "chat_id=${TG_CHANNEL}" \ - --data-urlencode "text=${MSG}" + --data-urlencode "text=${MSG}" \ + || echo "Telegram notification failed; continue pipeline"