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:
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
......@@ -317,7 +318,7 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
......@@ -379,6 +380,7 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
......@@ -429,7 +431,7 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
......@@ -481,7 +483,7 @@ jobs:
env:
NEXT_TELEMETRY_DISABLED: 1
NEXT_TEST_JOB: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN || secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
......
......@@ -20,6 +20,11 @@ const isTestJob = !!process.env.NEXT_TEST_JOB
const TIMINGS_API = `https://api.github.com/gists/4500dd89ae2f5d70d9aaceb191f528d1`
const TIMINGS_API_HEADERS = {
Accept: 'application/vnd.github.v3+json',
...(process.env.TEST_TIMINGS_TOKEN
? {
Authorization: `Bearer ${process.env.TEST_TIMINGS_TOKEN}`,
}
: {}),
}
const testFilters = {
......@@ -463,7 +468,6 @@ async function main() {
method: 'PATCH',
headers: {
...TIMINGS_API_HEADERS,
Authorization: `Bearer ${process.env.TEST_TIMINGS_TOKEN}`,
},
body: JSON.stringify({
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