Skip to content

Commit b35e0e9

Browse files
committed
testing webhook url
1 parent 13b9024 commit b35e0e9

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
WEBHOOK_URL="${{ secrets.WEBHOOK_URL }}"
2424
WEBHOOK_SECRET="${{ secrets.WEBHOOK_SECRET }}"
2525
26+
# Trim whitespace from secrets (GitHub secrets can have trailing newlines/spaces)
27+
WEBHOOK_URL=$(echo "$WEBHOOK_URL" | tr -d '\r\n' | xargs)
28+
WEBHOOK_SECRET=$(echo "$WEBHOOK_SECRET" | tr -d '\r\n' | xargs)
29+
2630
# Validate secrets are configured
2731
if [ -z "$WEBHOOK_URL" ]; then
2832
echo "Error: WEBHOOK_URL secret is not configured for $ENVIRONMENT environment"
@@ -36,8 +40,16 @@ jobs:
3640
exit 1
3741
fi
3842
43+
# Validate URL format
44+
if [[ ! "$WEBHOOK_URL" =~ ^https?:// ]]; then
45+
echo "Error: WEBHOOK_URL must start with http:// or https://"
46+
echo "Current value starts with: ${WEBHOOK_URL:0:20}..."
47+
echo "Please check the URL format in: Repository Settings → Environments → $ENVIRONMENT → Secrets"
48+
exit 1
49+
fi
50+
3951
echo "Triggering deployment webhook for $ENVIRONMENT..."
40-
echo "Webhook URL: $WEBHOOK_URL"
52+
echo "Webhook URL: ${WEBHOOK_URL:0:30}..." # Show first 30 chars only for security
4153
4254
# Create payload
4355
PAYLOAD=$(cat <<EOF
@@ -58,6 +70,7 @@ jobs:
5870
-H "X-Webhook-Secret: $WEBHOOK_SECRET" \
5971
-d "$PAYLOAD" \
6072
--fail --show-error \
61-
-w "\nHTTP Status: %{http_code}\n"
73+
-w "\nHTTP Status: %{http_code}\n" \
74+
--max-time 30
6275
6376
echo "Deployment webhook triggered successfully for $ENVIRONMENT"

0 commit comments

Comments
 (0)