Skip to content

Commit 538b574

Browse files
authored
ci: update all green to fail when the rate limit is reached (#8212)
1 parent e146182 commit 538b574

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

scripts/all-green.mjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@ const {
1313
RETRIES,
1414
} = process.env
1515

16-
const octokit = new Octokit({ auth: GITHUB_TOKEN })
16+
const octokit = new Octokit({
17+
auth: GITHUB_TOKEN,
18+
throttle: {
19+
onRateLimit: () => {
20+
console.error('GitHub API rate limit reached, failing immediately.')
21+
return false
22+
},
23+
onSecondaryRateLimit: () => {
24+
console.error('GitHub API secondary rate limit reached, failing immediately.')
25+
return false
26+
},
27+
},
28+
})
1729
const owner = 'DataDog'
1830
const repo = 'dd-trace-js'
1931
const ref = context.payload.pull_request?.head.sha || GITHUB_SHA

0 commit comments

Comments
 (0)