Unverified Commit c2e0271c authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Use test timings token when available (#44549)

This request occasionally gets a `403` response most likely from rate
limiting inside of GitHub actions so this attempts to increase our rate
limits by using the test timings token when available.

x-ref:
https://github.com/vercel/next.js/actions/runs/3833572871/jobs/6525160878
x-ref:
https://github.com/vercel/next.js/actions/runs/3833158940/attempts/1
parent a25d800f
...@@ -257,6 +257,7 @@ jobs: ...@@ -257,6 +257,7 @@ jobs:
env: env:
NEXT_TELEMETRY_DISABLED: 1 NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1 NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
...@@ -317,7 +318,7 @@ jobs: ...@@ -317,7 +318,7 @@ jobs:
env: env:
NEXT_TELEMETRY_DISABLED: 1 NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1 NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }} TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
...@@ -379,6 +380,7 @@ jobs: ...@@ -379,6 +380,7 @@ jobs:
env: env:
NEXT_TELEMETRY_DISABLED: 1 NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1 NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
...@@ -429,7 +431,7 @@ jobs: ...@@ -429,7 +431,7 @@ jobs:
env: env:
NEXT_TELEMETRY_DISABLED: 1 NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1 NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }} TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
...@@ -481,7 +483,7 @@ jobs: ...@@ -481,7 +483,7 @@ jobs:
env: env:
NEXT_TELEMETRY_DISABLED: 1 NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1 NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }} TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
......
...@@ -20,6 +20,11 @@ const isTestJob = !!process.env.NEXT_TEST_JOB ...@@ -20,6 +20,11 @@ const isTestJob = !!process.env.NEXT_TEST_JOB
const TIMINGS_API = `https://api.github.com/gists/4500dd89ae2f5d70d9aaceb191f528d1` const TIMINGS_API = `https://api.github.com/gists/4500dd89ae2f5d70d9aaceb191f528d1`
const TIMINGS_API_HEADERS = { const TIMINGS_API_HEADERS = {
Accept: 'application/vnd.github.v3+json', Accept: 'application/vnd.github.v3+json',
...(process.env.TEST_TIMINGS_TOKEN
? {
Authorization: `Bearer ${process.env.TEST_TIMINGS_TOKEN}`,
}
: {}),
} }
const testFilters = { const testFilters = {
...@@ -463,7 +468,6 @@ async function main() { ...@@ -463,7 +468,6 @@ async function main() {
method: 'PATCH', method: 'PATCH',
headers: { headers: {
...TIMINGS_API_HEADERS, ...TIMINGS_API_HEADERS,
Authorization: `Bearer ${process.env.TEST_TIMINGS_TOKEN}`,
}, },
body: JSON.stringify({ body: JSON.stringify({
files: { files: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment