|
| 1 | +name: Vercel credential probe |
| 2 | + |
| 3 | +# Temporary diagnostic. The hosted web deploy fails with "User not found (404)" |
| 4 | +# and each retry costs a full four-platform build, so this exercises the token |
| 5 | +# on its own. Delete once the deploy is green. |
| 6 | +on: |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + probe: |
| 11 | + runs-on: blacksmith-8vcpu-ubuntu-2404 |
| 12 | + timeout-minutes: 5 |
| 13 | + env: |
| 14 | + VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} |
| 15 | + VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} |
| 16 | + VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} |
| 17 | + VERCEL_TEAM_SLUG: ${{ vars.VERCEL_TEAM_SLUG }} |
| 18 | + steps: |
| 19 | + - name: Probe token |
| 20 | + shell: bash |
| 21 | + run: | |
| 22 | + set -uo pipefail |
| 23 | + echo "token length: ${#VERCEL_TOKEN}" |
| 24 | + echo "org id: $VERCEL_ORG_ID" |
| 25 | + echo "team slug: ${VERCEL_TEAM_SLUG:-<unset>}" |
| 26 | +
|
| 27 | + echo "--- 1. whoami (no scope) ---" |
| 28 | + npx --yes vercel@53.1.1 whoami --token "$VERCEL_TOKEN" 2>&1 | tail -3 |
| 29 | +
|
| 30 | + echo "--- 2. project ls, scope = team slug ---" |
| 31 | + npx --yes vercel@53.1.1 project ls --token "$VERCEL_TOKEN" \ |
| 32 | + --scope "${VERCEL_TEAM_SLUG}" 2>&1 | tail -5 |
| 33 | +
|
| 34 | + echo "--- 3. project ls, scope = org id ---" |
| 35 | + npx --yes vercel@53.1.1 project ls --token "$VERCEL_TOKEN" \ |
| 36 | + --scope "$VERCEL_ORG_ID" 2>&1 | tail -5 |
| 37 | +
|
| 38 | + echo "--- 4. project ls, no scope (env vars only) ---" |
| 39 | + npx --yes vercel@53.1.1 project ls --token "$VERCEL_TOKEN" 2>&1 | tail -5 |
| 40 | +
|
| 41 | + echo "--- 5. raw API: /v2/user ---" |
| 42 | + curl -sS -o /dev/null -w " /v2/user -> %{http_code}\n" \ |
| 43 | + -H "Authorization: Bearer $VERCEL_TOKEN" https://api.vercel.com/v2/user |
| 44 | +
|
| 45 | + echo "--- 6. raw API: project by id, scoped to team ---" |
| 46 | + curl -sS -o /dev/null -w " /v9/projects -> %{http_code}\n" \ |
| 47 | + -H "Authorization: Bearer $VERCEL_TOKEN" \ |
| 48 | + "https://api.vercel.com/v9/projects/${VERCEL_PROJECT_ID}?teamId=${VERCEL_ORG_ID}" |
0 commit comments