Skip to content

Commit 691476f

Browse files
committed
fix: another try
1 parent be7b6da commit 691476f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

scripts/vercel-ignore-build.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ if [ -n "$VERCEL_GIT_PULL_REQUEST_ID" ] && [ -n "$GITHUB_TOKEN" ]; then
1919
API_URL="https://api.github.com/repos/$VERCEL_GIT_REPO_OWNER/$VERCEL_GIT_REPO_SLUG/pulls/$VERCEL_GIT_PULL_REQUEST_ID"
2020
echo "API URL: $API_URL"
2121

22+
# Debug: Check if token exists (show first 4 chars)
23+
if [ -n "$GITHUB_TOKEN" ]; then
24+
echo "GitHub token: ${GITHUB_TOKEN:0:4}..."
25+
else
26+
echo "⚠️ No GitHub token found"
27+
fi
28+
2229
# Get PR info from GitHub API (using grep/sed instead of jq since it's not available in Vercel)
2330
PR_RESPONSE=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "$API_URL")
2431

@@ -32,8 +39,14 @@ if [ -n "$VERCEL_GIT_PULL_REQUEST_ID" ] && [ -n "$GITHUB_TOKEN" ]; then
3239
echo "⚠️ GitHub API error: $ERROR_MSG"
3340
fi
3441

35-
# Debug: Show first 200 chars of response
36-
echo "Response preview: $(echo "$PR_RESPONSE" | head -c 200)..."
42+
# Debug: Look for base.ref in response (show more context)
43+
echo "Looking for base.ref pattern..."
44+
echo "$PR_RESPONSE" | grep -o '"base":[^}]*' | head -c 500
45+
echo ""
46+
47+
# Also try to find just the ref field near base
48+
echo "Searching for 'base' context..."
49+
echo "$PR_RESPONSE" | grep -C 2 '"base"' | head -n 10
3750
fi
3851

3952
# Extract base.ref from JSON using sed (looking for pattern: "base":{"ref":"branch-name")

0 commit comments

Comments
 (0)