Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 48 additions & 25 deletions .github/local-actions/branch-manager/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -67132,11 +67132,16 @@ async function getAppAuthentication({
timeDifference
}) {
try {
const appAuthentication = await githubAppJwt({
const authOptions = {
id: appId,
privateKey,
now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference
});
privateKey
};
if (timeDifference) {
Object.assign(authOptions, {
now: Math.floor(Date.now() / 1e3) + timeDifference
});
}
const appAuthentication = await githubAppJwt(authOptions);
return {
type: "app",
token: appAuthentication.token,
Expand Down Expand Up @@ -67299,6 +67304,26 @@ async function getInstallationAuthentication(state, options, customRequest) {
}
const appAuthentication = await getAppAuthentication(state);
const request2 = customRequest || state.request;
const payload = {
installation_id: installationId,
mediaType: {
previews: ["machine-man"]
},
headers: {
authorization: `bearer ${appAuthentication.token}`
}
};
if (options.repositoryIds) {
Object.assign(payload, { repository_ids: options.repositoryIds });
}
if (options.repositoryNames) {
Object.assign(payload, {
repositories: options.repositoryNames
});
}
if (options.permissions) {
Object.assign(payload, { permissions: options.permissions });
}
const {
data: {
token: token2,
Expand All @@ -67308,44 +67333,42 @@ async function getInstallationAuthentication(state, options, customRequest) {
repository_selection: repositorySelectionOptional,
single_file: singleFileName
}
} = await request2("POST /app/installations/{installation_id}/access_tokens", {
installation_id: installationId,
repository_ids: options.repositoryIds,
repositories: options.repositoryNames,
permissions: options.permissions,
mediaType: {
previews: ["machine-man"]
},
headers: {
authorization: `bearer ${appAuthentication.token}`
}
});
} = await request2(
"POST /app/installations/{installation_id}/access_tokens",
payload
);
const permissions = permissionsOptional || {};
const repositorySelection = repositorySelectionOptional || "all";
const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0;
const repositoryNames = repositories ? repositories.map((repo2) => repo2.name) : void 0;
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
await set(state.cache, optionsWithInstallationTokenFromState, {
const cacheOptions = {
token: token2,
createdAt,
expiresAt,
repositorySelection,
permissions,
repositoryIds,
repositoryNames,
singleFileName
});
return toTokenAuthentication({
repositoryNames
};
if (singleFileName) {
Object.assign(payload, { singleFileName });
}
await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions);
const cacheData = {
installationId,
token: token2,
createdAt,
expiresAt,
repositorySelection,
permissions,
repositoryIds,
repositoryNames,
singleFileName
});
repositoryNames
};
if (singleFileName) {
Object.assign(cacheData, { singleFileName });
}
return toTokenAuthentication(cacheData);
}
async function auth5(state, authOptions) {
switch (authOptions.type) {
Expand Down Expand Up @@ -67483,7 +67506,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri
return sendRequestWithRetries(state, request2, options, createdAt, retries);
}
}
var VERSION12 = "7.1.1";
var VERSION12 = "7.1.2";
function createAppAuth(options) {
if (!options.appId) {
throw new Error("[@octokit/auth-app] appId option is required");
Expand Down
73 changes: 48 additions & 25 deletions .github/local-actions/changelog/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -66207,11 +66207,16 @@ async function getAppAuthentication({
timeDifference
}) {
try {
const appAuthentication = await githubAppJwt({
const authOptions = {
id: appId,
privateKey,
now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference
});
privateKey
};
if (timeDifference) {
Object.assign(authOptions, {
now: Math.floor(Date.now() / 1e3) + timeDifference
});
}
const appAuthentication = await githubAppJwt(authOptions);
return {
type: "app",
token: appAuthentication.token,
Expand Down Expand Up @@ -66374,6 +66379,26 @@ async function getInstallationAuthentication(state, options, customRequest) {
}
const appAuthentication = await getAppAuthentication(state);
const request2 = customRequest || state.request;
const payload = {
installation_id: installationId,
mediaType: {
previews: ["machine-man"]
},
headers: {
authorization: `bearer ${appAuthentication.token}`
}
};
if (options.repositoryIds) {
Object.assign(payload, { repository_ids: options.repositoryIds });
}
if (options.repositoryNames) {
Object.assign(payload, {
repositories: options.repositoryNames
});
}
if (options.permissions) {
Object.assign(payload, { permissions: options.permissions });
}
const {
data: {
token,
Expand All @@ -66383,44 +66408,42 @@ async function getInstallationAuthentication(state, options, customRequest) {
repository_selection: repositorySelectionOptional,
single_file: singleFileName
}
} = await request2("POST /app/installations/{installation_id}/access_tokens", {
installation_id: installationId,
repository_ids: options.repositoryIds,
repositories: options.repositoryNames,
permissions: options.permissions,
mediaType: {
previews: ["machine-man"]
},
headers: {
authorization: `bearer ${appAuthentication.token}`
}
});
} = await request2(
"POST /app/installations/{installation_id}/access_tokens",
payload
);
const permissions = permissionsOptional || {};
const repositorySelection = repositorySelectionOptional || "all";
const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0;
const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0;
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
await set(state.cache, optionsWithInstallationTokenFromState, {
const cacheOptions = {
token,
createdAt,
expiresAt,
repositorySelection,
permissions,
repositoryIds,
repositoryNames,
singleFileName
});
return toTokenAuthentication({
repositoryNames
};
if (singleFileName) {
Object.assign(payload, { singleFileName });
}
await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions);
const cacheData = {
installationId,
token,
createdAt,
expiresAt,
repositorySelection,
permissions,
repositoryIds,
repositoryNames,
singleFileName
});
repositoryNames
};
if (singleFileName) {
Object.assign(cacheData, { singleFileName });
}
return toTokenAuthentication(cacheData);
}
async function auth5(state, authOptions) {
switch (authOptions.type) {
Expand Down Expand Up @@ -66558,7 +66581,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri
return sendRequestWithRetries(state, request2, options, createdAt, retries);
}
}
var VERSION12 = "7.1.1";
var VERSION12 = "7.1.2";
function createAppAuth(options) {
if (!options.appId) {
throw new Error("[@octokit/auth-app] appId option is required");
Expand Down
73 changes: 48 additions & 25 deletions .github/local-actions/labels-sync/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45835,11 +45835,16 @@ async function getAppAuthentication({
timeDifference
}) {
try {
const appAuthentication = await githubAppJwt({
const authOptions = {
id: appId,
privateKey,
now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference
});
privateKey
};
if (timeDifference) {
Object.assign(authOptions, {
now: Math.floor(Date.now() / 1e3) + timeDifference
});
}
const appAuthentication = await githubAppJwt(authOptions);
return {
type: "app",
token: appAuthentication.token,
Expand Down Expand Up @@ -46002,6 +46007,26 @@ async function getInstallationAuthentication(state, options, customRequest) {
}
const appAuthentication = await getAppAuthentication(state);
const request2 = customRequest || state.request;
const payload = {
installation_id: installationId,
mediaType: {
previews: ["machine-man"]
},
headers: {
authorization: `bearer ${appAuthentication.token}`
}
};
if (options.repositoryIds) {
Object.assign(payload, { repository_ids: options.repositoryIds });
}
if (options.repositoryNames) {
Object.assign(payload, {
repositories: options.repositoryNames
});
}
if (options.permissions) {
Object.assign(payload, { permissions: options.permissions });
}
const {
data: {
token,
Expand All @@ -46011,44 +46036,42 @@ async function getInstallationAuthentication(state, options, customRequest) {
repository_selection: repositorySelectionOptional,
single_file: singleFileName
}
} = await request2("POST /app/installations/{installation_id}/access_tokens", {
installation_id: installationId,
repository_ids: options.repositoryIds,
repositories: options.repositoryNames,
permissions: options.permissions,
mediaType: {
previews: ["machine-man"]
},
headers: {
authorization: `bearer ${appAuthentication.token}`
}
});
} = await request2(
"POST /app/installations/{installation_id}/access_tokens",
payload
);
const permissions = permissionsOptional || {};
const repositorySelection = repositorySelectionOptional || "all";
const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0;
const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0;
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
await set(state.cache, optionsWithInstallationTokenFromState, {
const cacheOptions = {
token,
createdAt,
expiresAt,
repositorySelection,
permissions,
repositoryIds,
repositoryNames,
singleFileName
});
return toTokenAuthentication({
repositoryNames
};
if (singleFileName) {
Object.assign(payload, { singleFileName });
}
await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions);
const cacheData = {
installationId,
token,
createdAt,
expiresAt,
repositorySelection,
permissions,
repositoryIds,
repositoryNames,
singleFileName
});
repositoryNames
};
if (singleFileName) {
Object.assign(cacheData, { singleFileName });
}
return toTokenAuthentication(cacheData);
}
async function auth5(state, authOptions) {
switch (authOptions.type) {
Expand Down Expand Up @@ -46186,7 +46209,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri
return sendRequestWithRetries(state, request2, options, createdAt, retries);
}
}
var VERSION12 = "7.1.1";
var VERSION12 = "7.1.2";
function createAppAuth(options) {
if (!options.appId) {
throw new Error("[@octokit/auth-app] appId option is required");
Expand Down
Loading