Skip to content

Commit 7898454

Browse files
angular-robotjosephperrott
authored andcommitted
build: update dependency @octokit/auth-app to v7.1.2 (#2420)
PR Close #2420
1 parent 82d23bc commit 7898454

File tree

13 files changed

+543
-283
lines changed

13 files changed

+543
-283
lines changed

.github/local-actions/branch-manager/main.js

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -67132,11 +67132,16 @@ async function getAppAuthentication({
6713267132
timeDifference
6713367133
}) {
6713467134
try {
67135-
const appAuthentication = await githubAppJwt({
67135+
const authOptions = {
6713667136
id: appId,
67137-
privateKey,
67138-
now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference
67139-
});
67137+
privateKey
67138+
};
67139+
if (timeDifference) {
67140+
Object.assign(authOptions, {
67141+
now: Math.floor(Date.now() / 1e3) + timeDifference
67142+
});
67143+
}
67144+
const appAuthentication = await githubAppJwt(authOptions);
6714067145
return {
6714167146
type: "app",
6714267147
token: appAuthentication.token,
@@ -67299,6 +67304,26 @@ async function getInstallationAuthentication(state, options, customRequest) {
6729967304
}
6730067305
const appAuthentication = await getAppAuthentication(state);
6730167306
const request2 = customRequest || state.request;
67307+
const payload = {
67308+
installation_id: installationId,
67309+
mediaType: {
67310+
previews: ["machine-man"]
67311+
},
67312+
headers: {
67313+
authorization: `bearer ${appAuthentication.token}`
67314+
}
67315+
};
67316+
if (options.repositoryIds) {
67317+
Object.assign(payload, { repository_ids: options.repositoryIds });
67318+
}
67319+
if (options.repositoryNames) {
67320+
Object.assign(payload, {
67321+
repositories: options.repositoryNames
67322+
});
67323+
}
67324+
if (options.permissions) {
67325+
Object.assign(payload, { permissions: options.permissions });
67326+
}
6730267327
const {
6730367328
data: {
6730467329
token: token2,
@@ -67308,44 +67333,42 @@ async function getInstallationAuthentication(state, options, customRequest) {
6730867333
repository_selection: repositorySelectionOptional,
6730967334
single_file: singleFileName
6731067335
}
67311-
} = await request2("POST /app/installations/{installation_id}/access_tokens", {
67312-
installation_id: installationId,
67313-
repository_ids: options.repositoryIds,
67314-
repositories: options.repositoryNames,
67315-
permissions: options.permissions,
67316-
mediaType: {
67317-
previews: ["machine-man"]
67318-
},
67319-
headers: {
67320-
authorization: `bearer ${appAuthentication.token}`
67321-
}
67322-
});
67336+
} = await request2(
67337+
"POST /app/installations/{installation_id}/access_tokens",
67338+
payload
67339+
);
6732367340
const permissions = permissionsOptional || {};
6732467341
const repositorySelection = repositorySelectionOptional || "all";
6732567342
const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0;
6732667343
const repositoryNames = repositories ? repositories.map((repo2) => repo2.name) : void 0;
6732767344
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
67328-
await set(state.cache, optionsWithInstallationTokenFromState, {
67345+
const cacheOptions = {
6732967346
token: token2,
6733067347
createdAt,
6733167348
expiresAt,
6733267349
repositorySelection,
6733367350
permissions,
6733467351
repositoryIds,
67335-
repositoryNames,
67336-
singleFileName
67337-
});
67338-
return toTokenAuthentication({
67352+
repositoryNames
67353+
};
67354+
if (singleFileName) {
67355+
Object.assign(payload, { singleFileName });
67356+
}
67357+
await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions);
67358+
const cacheData = {
6733967359
installationId,
6734067360
token: token2,
6734167361
createdAt,
6734267362
expiresAt,
6734367363
repositorySelection,
6734467364
permissions,
6734567365
repositoryIds,
67346-
repositoryNames,
67347-
singleFileName
67348-
});
67366+
repositoryNames
67367+
};
67368+
if (singleFileName) {
67369+
Object.assign(cacheData, { singleFileName });
67370+
}
67371+
return toTokenAuthentication(cacheData);
6734967372
}
6735067373
async function auth5(state, authOptions) {
6735167374
switch (authOptions.type) {
@@ -67483,7 +67506,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri
6748367506
return sendRequestWithRetries(state, request2, options, createdAt, retries);
6748467507
}
6748567508
}
67486-
var VERSION12 = "7.1.1";
67509+
var VERSION12 = "7.1.2";
6748767510
function createAppAuth(options) {
6748867511
if (!options.appId) {
6748967512
throw new Error("[@octokit/auth-app] appId option is required");

.github/local-actions/changelog/main.js

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -66207,11 +66207,16 @@ async function getAppAuthentication({
6620766207
timeDifference
6620866208
}) {
6620966209
try {
66210-
const appAuthentication = await githubAppJwt({
66210+
const authOptions = {
6621166211
id: appId,
66212-
privateKey,
66213-
now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference
66214-
});
66212+
privateKey
66213+
};
66214+
if (timeDifference) {
66215+
Object.assign(authOptions, {
66216+
now: Math.floor(Date.now() / 1e3) + timeDifference
66217+
});
66218+
}
66219+
const appAuthentication = await githubAppJwt(authOptions);
6621566220
return {
6621666221
type: "app",
6621766222
token: appAuthentication.token,
@@ -66374,6 +66379,26 @@ async function getInstallationAuthentication(state, options, customRequest) {
6637466379
}
6637566380
const appAuthentication = await getAppAuthentication(state);
6637666381
const request2 = customRequest || state.request;
66382+
const payload = {
66383+
installation_id: installationId,
66384+
mediaType: {
66385+
previews: ["machine-man"]
66386+
},
66387+
headers: {
66388+
authorization: `bearer ${appAuthentication.token}`
66389+
}
66390+
};
66391+
if (options.repositoryIds) {
66392+
Object.assign(payload, { repository_ids: options.repositoryIds });
66393+
}
66394+
if (options.repositoryNames) {
66395+
Object.assign(payload, {
66396+
repositories: options.repositoryNames
66397+
});
66398+
}
66399+
if (options.permissions) {
66400+
Object.assign(payload, { permissions: options.permissions });
66401+
}
6637766402
const {
6637866403
data: {
6637966404
token,
@@ -66383,44 +66408,42 @@ async function getInstallationAuthentication(state, options, customRequest) {
6638366408
repository_selection: repositorySelectionOptional,
6638466409
single_file: singleFileName
6638566410
}
66386-
} = await request2("POST /app/installations/{installation_id}/access_tokens", {
66387-
installation_id: installationId,
66388-
repository_ids: options.repositoryIds,
66389-
repositories: options.repositoryNames,
66390-
permissions: options.permissions,
66391-
mediaType: {
66392-
previews: ["machine-man"]
66393-
},
66394-
headers: {
66395-
authorization: `bearer ${appAuthentication.token}`
66396-
}
66397-
});
66411+
} = await request2(
66412+
"POST /app/installations/{installation_id}/access_tokens",
66413+
payload
66414+
);
6639866415
const permissions = permissionsOptional || {};
6639966416
const repositorySelection = repositorySelectionOptional || "all";
6640066417
const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0;
6640166418
const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0;
6640266419
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
66403-
await set(state.cache, optionsWithInstallationTokenFromState, {
66420+
const cacheOptions = {
6640466421
token,
6640566422
createdAt,
6640666423
expiresAt,
6640766424
repositorySelection,
6640866425
permissions,
6640966426
repositoryIds,
66410-
repositoryNames,
66411-
singleFileName
66412-
});
66413-
return toTokenAuthentication({
66427+
repositoryNames
66428+
};
66429+
if (singleFileName) {
66430+
Object.assign(payload, { singleFileName });
66431+
}
66432+
await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions);
66433+
const cacheData = {
6641466434
installationId,
6641566435
token,
6641666436
createdAt,
6641766437
expiresAt,
6641866438
repositorySelection,
6641966439
permissions,
6642066440
repositoryIds,
66421-
repositoryNames,
66422-
singleFileName
66423-
});
66441+
repositoryNames
66442+
};
66443+
if (singleFileName) {
66444+
Object.assign(cacheData, { singleFileName });
66445+
}
66446+
return toTokenAuthentication(cacheData);
6642466447
}
6642566448
async function auth5(state, authOptions) {
6642666449
switch (authOptions.type) {
@@ -66558,7 +66581,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri
6655866581
return sendRequestWithRetries(state, request2, options, createdAt, retries);
6655966582
}
6656066583
}
66561-
var VERSION12 = "7.1.1";
66584+
var VERSION12 = "7.1.2";
6656266585
function createAppAuth(options) {
6656366586
if (!options.appId) {
6656466587
throw new Error("[@octokit/auth-app] appId option is required");

.github/local-actions/labels-sync/main.js

Lines changed: 48 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45835,11 +45835,16 @@ async function getAppAuthentication({
4583545835
timeDifference
4583645836
}) {
4583745837
try {
45838-
const appAuthentication = await githubAppJwt({
45838+
const authOptions = {
4583945839
id: appId,
45840-
privateKey,
45841-
now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference
45842-
});
45840+
privateKey
45841+
};
45842+
if (timeDifference) {
45843+
Object.assign(authOptions, {
45844+
now: Math.floor(Date.now() / 1e3) + timeDifference
45845+
});
45846+
}
45847+
const appAuthentication = await githubAppJwt(authOptions);
4584345848
return {
4584445849
type: "app",
4584545850
token: appAuthentication.token,
@@ -46002,6 +46007,26 @@ async function getInstallationAuthentication(state, options, customRequest) {
4600246007
}
4600346008
const appAuthentication = await getAppAuthentication(state);
4600446009
const request2 = customRequest || state.request;
46010+
const payload = {
46011+
installation_id: installationId,
46012+
mediaType: {
46013+
previews: ["machine-man"]
46014+
},
46015+
headers: {
46016+
authorization: `bearer ${appAuthentication.token}`
46017+
}
46018+
};
46019+
if (options.repositoryIds) {
46020+
Object.assign(payload, { repository_ids: options.repositoryIds });
46021+
}
46022+
if (options.repositoryNames) {
46023+
Object.assign(payload, {
46024+
repositories: options.repositoryNames
46025+
});
46026+
}
46027+
if (options.permissions) {
46028+
Object.assign(payload, { permissions: options.permissions });
46029+
}
4600546030
const {
4600646031
data: {
4600746032
token,
@@ -46011,44 +46036,42 @@ async function getInstallationAuthentication(state, options, customRequest) {
4601146036
repository_selection: repositorySelectionOptional,
4601246037
single_file: singleFileName
4601346038
}
46014-
} = await request2("POST /app/installations/{installation_id}/access_tokens", {
46015-
installation_id: installationId,
46016-
repository_ids: options.repositoryIds,
46017-
repositories: options.repositoryNames,
46018-
permissions: options.permissions,
46019-
mediaType: {
46020-
previews: ["machine-man"]
46021-
},
46022-
headers: {
46023-
authorization: `bearer ${appAuthentication.token}`
46024-
}
46025-
});
46039+
} = await request2(
46040+
"POST /app/installations/{installation_id}/access_tokens",
46041+
payload
46042+
);
4602646043
const permissions = permissionsOptional || {};
4602746044
const repositorySelection = repositorySelectionOptional || "all";
4602846045
const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0;
4602946046
const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0;
4603046047
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
46031-
await set(state.cache, optionsWithInstallationTokenFromState, {
46048+
const cacheOptions = {
4603246049
token,
4603346050
createdAt,
4603446051
expiresAt,
4603546052
repositorySelection,
4603646053
permissions,
4603746054
repositoryIds,
46038-
repositoryNames,
46039-
singleFileName
46040-
});
46041-
return toTokenAuthentication({
46055+
repositoryNames
46056+
};
46057+
if (singleFileName) {
46058+
Object.assign(payload, { singleFileName });
46059+
}
46060+
await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions);
46061+
const cacheData = {
4604246062
installationId,
4604346063
token,
4604446064
createdAt,
4604546065
expiresAt,
4604646066
repositorySelection,
4604746067
permissions,
4604846068
repositoryIds,
46049-
repositoryNames,
46050-
singleFileName
46051-
});
46069+
repositoryNames
46070+
};
46071+
if (singleFileName) {
46072+
Object.assign(cacheData, { singleFileName });
46073+
}
46074+
return toTokenAuthentication(cacheData);
4605246075
}
4605346076
async function auth5(state, authOptions) {
4605446077
switch (authOptions.type) {
@@ -46186,7 +46209,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri
4618646209
return sendRequestWithRetries(state, request2, options, createdAt, retries);
4618746210
}
4618846211
}
46189-
var VERSION12 = "7.1.1";
46212+
var VERSION12 = "7.1.2";
4619046213
function createAppAuth(options) {
4619146214
if (!options.appId) {
4619246215
throw new Error("[@octokit/auth-app] appId option is required");

0 commit comments

Comments
 (0)