From d8fb5bf6507ca56b57e0c0b8bdfce65e65d006e5 Mon Sep 17 00:00:00 2001 From: Sriniketh24 Date: Tue, 17 Feb 2026 16:26:30 -0500 Subject: [PATCH] refactor(ci): use curl + retries for website build webhook --- .github/workflows/website-build.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/website-build.yml b/.github/workflows/website-build.yml index b000151..4a53651 100644 --- a/.github/workflows/website-build.yml +++ b/.github/workflows/website-build.yml @@ -1,14 +1,36 @@ +name: Trigger Website Build + on: release: types: - published - unpublished - deleted + +permissions: + contents: read + jobs: trigger-website-build: runs-on: ubuntu-latest + timeout-minutes: 5 steps: - - name: Install HTTPie - run: sudo snap install --edge httpie - name: Trigger website build - run: http --ignore-stdin POST ${{ secrets.PIE_WEB_VERCEL_HOOK }} + env: + WEBHOOK_URL: ${{ secrets.PIE_WEB_VERCEL_HOOK }} + run: | + set -euo pipefail + if [[ -z "${WEBHOOK_URL:-}" ]]; then + echo "::error::PIE_WEB_VERCEL_HOOK secret is not set" + exit 1 + fi + for i in 1 2 3; do + if curl -fsS -X POST "${WEBHOOK_URL}"; then + echo "Webhook triggered successfully (attempt $i)" + exit 0 + fi + echo "Attempt $i failed, retrying..." + sleep 5 + done + echo "::error::Failed to trigger webhook after 3 attempts" + exit 1