Skip to content

Commit 7dd9901

Browse files
actions-botgithub-actions[bot]
authored andcommitted
build: update distribution
1 parent e89bd69 commit 7dd9901

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

dist/index.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36090,8 +36090,9 @@ function wrapRequest(state, request, options) {
3609036090
return state.retryLimiter.schedule(doRequest, state, request, options);
3609136091
}
3609236092
async function doRequest(state, request, options) {
36093-
const isWrite = options.method !== "GET" && options.method !== "HEAD";
3609436093
const { pathname } = new URL(options.url, "http://github.test");
36094+
const isAuth = isAuthRequest(options.method, pathname);
36095+
const isWrite = !isAuth && options.method !== "GET" && options.method !== "HEAD";
3609536096
const isSearch = options.method === "GET" && pathname.startsWith("/search/");
3609636097
const isGraphQL = pathname.startsWith("/graphql");
3609736098
const retryCount = ~~request.retryCount;
@@ -36108,7 +36109,7 @@ async function doRequest(state, request, options) {
3610836109
if (isSearch) {
3610936110
await state.search.key(state.id).schedule(jobOptions, noop);
3611036111
}
36111-
const req = state.global.key(state.id).schedule(jobOptions, request, options);
36112+
const req = (isAuth ? state.auth : state.global).key(state.id).schedule(jobOptions, request, options);
3611236113
if (isGraphQL) {
3611336114
const res = await req;
3611436115
if (res.data.errors != null && res.data.errors.some((error) => error.type === "RATE_LIMITED")) {
@@ -36121,6 +36122,13 @@ async function doRequest(state, request, options) {
3612136122
}
3612236123
return req;
3612336124
}
36125+
function isAuthRequest(method, pathname) {
36126+
return method === "PATCH" && // https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-a-scoped-access-token
36127+
/^\/applications\/[^/]+\/token\/scoped$/.test(pathname) || method === "POST" && // https://docs.github.com/en/rest/apps/oauth-applications?apiVersion=2022-11-28#reset-a-token
36128+
(/^\/applications\/[^/]+\/token$/.test(pathname) || // https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app
36129+
/^\/app\/installations\/[^/]+\/access_tokens$/.test(pathname) || // https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps
36130+
pathname === "/login/oauth/access_token");
36131+
}
3612436132

3612536133
// pkg/dist-src/generated/triggers-notification-paths.js
3612636134
var triggers_notification_paths_default = [
@@ -36164,6 +36172,11 @@ var createGroups = function(Bottleneck, common) {
3616436172
maxConcurrent: 10,
3616536173
...common
3616636174
});
36175+
groups.auth = new Bottleneck.Group({
36176+
id: "octokit-auth",
36177+
maxConcurrent: 1,
36178+
...common
36179+
});
3616736180
groups.search = new Bottleneck.Group({
3616836181
id: "octokit-search",
3616936182
maxConcurrent: 1,

0 commit comments

Comments
 (0)