ci/github-script/commits: init from ci/check-cherry-picks

This turns the check-cherry-pick script into a github-script based
JavaScript program. This makes it much easier to extend to check reverts
or merge commits later on.
This commit is contained in:
Wolfgang Walther
2025-07-13 19:42:12 +02:00
parent 2433050fb7
commit b46cb23251
8 changed files with 252 additions and 201 deletions

View File

@@ -20,6 +20,8 @@ module.exports = async function ({ github, core }, callback) {
// Pause between mutative requests
const writeLimits = new Bottleneck({ minTime: 1000 }).chain(allLimits)
github.hook.wrap('request', async (request, options) => {
// Requests to a different host do not count against the rate limit.
if (options.url.startsWith('https://github.com')) return request(options)
// Requests to the /rate_limit endpoint do not count against the rate limit.
if (options.url == '/rate_limit') return request(options)
// Search requests are in a different resource group, which allows 30 requests / minute.