[tests] Use new VERCEL_TEST_TOKEN for tests (#8614)

Use `VERCEL_TEST_TOKEN` for tests
This commit is contained in:
Mark Glagola
2022-09-22 15:07:43 -05:00
committed by GitHub
parent 0ecfdc1325
commit 225e0a4de3
3 changed files with 9 additions and 9 deletions

View File

@@ -40,5 +40,5 @@ jobs:
- run: yarn run build - run: yarn run build
- run: yarn test-integration-cli - run: yarn test-integration-cli
env: env:
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }} VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_REGISTRATION_URL: ${{ secrets.VERCEL_REGISTRATION_URL }} VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}

View File

@@ -88,8 +88,8 @@ jobs:
shell: bash shell: bash
env: env:
VERCEL_CLI_VERSION: ${{ needs.setup.outputs.dplUrl }}/tarballs/vercel.tgz VERCEL_CLI_VERSION: ${{ needs.setup.outputs.dplUrl }}/tarballs/vercel.tgz
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }} VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_REGISTRATION_URL: ${{ secrets.VERCEL_REGISTRATION_URL }} VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
FORCE_COLOR: '1' FORCE_COLOR: '1'
conclusion: conclusion:

View File

@@ -200,8 +200,8 @@ async function fetchTokenWithRetry(retries = 5) {
NOW_TOKEN, NOW_TOKEN,
TEMP_TOKEN, TEMP_TOKEN,
VERCEL_TOKEN, VERCEL_TOKEN,
VERCEL_TEAM_TOKEN, VERCEL_TEST_TOKEN,
VERCEL_REGISTRATION_URL, VERCEL_TEST_REGISTRATION_URL,
} = process.env; } = process.env;
if (VERCEL_TOKEN || NOW_TOKEN || TEMP_TOKEN) { if (VERCEL_TOKEN || NOW_TOKEN || TEMP_TOKEN) {
if (!TEMP_TOKEN) { if (!TEMP_TOKEN) {
@@ -211,7 +211,7 @@ async function fetchTokenWithRetry(retries = 5) {
} }
return VERCEL_TOKEN || NOW_TOKEN || TEMP_TOKEN; return VERCEL_TOKEN || NOW_TOKEN || TEMP_TOKEN;
} }
if (!VERCEL_TEAM_TOKEN || !VERCEL_REGISTRATION_URL) { if (!VERCEL_TEST_TOKEN || !VERCEL_TEST_REGISTRATION_URL) {
throw new Error( throw new Error(
process.env.CI process.env.CI
? 'Failed to create test deployment. This is expected for 3rd-party Pull Requests. Please run tests locally.' ? 'Failed to create test deployment. This is expected for 3rd-party Pull Requests. Please run tests locally.'
@@ -219,10 +219,10 @@ async function fetchTokenWithRetry(retries = 5) {
); );
} }
try { try {
const res = await _fetch(VERCEL_REGISTRATION_URL, { const res = await _fetch(VERCEL_TEST_REGISTRATION_URL, {
method: 'POST', method: 'POST',
headers: { headers: {
Authorization: `Bearer ${VERCEL_TEAM_TOKEN}`, Authorization: `Bearer ${VERCEL_TEST_TOKEN}`,
}, },
}); });
if (!res.ok) { if (!res.ok) {