Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2986852ad8 | |||
| 495056a515 | |||
| 8746053070 | |||
| 46e4a501e1 | |||
| 2e5cc74af2 | |||
| 474769db88 |
@@ -157,8 +157,8 @@ jobs:
|
||||
- uses: actions/create-github-app-token@v1
|
||||
id: app-token
|
||||
with:
|
||||
app_id: ${{ vars.APP_ID }}
|
||||
private_key: ${{ secrets.PRIVATE_KEY }}
|
||||
app-id: ${{ vars.APP_ID }}
|
||||
private-key: ${{ secrets.PRIVATE_KEY }}
|
||||
owner: ${{ matrix.owners-and-repos.owner }}
|
||||
repositories: ${{ join(matrix.owners-and-repos.repos) }}
|
||||
- uses: octokit/request-action@v2.x
|
||||
|
||||
Vendored
+24
-17
@@ -2811,8 +2811,18 @@ var require_dist_node5 = __commonJS({
|
||||
module2.exports = __toCommonJS2(dist_src_exports);
|
||||
var import_endpoint = require_dist_node2();
|
||||
var import_universal_user_agent = require_dist_node();
|
||||
var VERSION = "8.1.4";
|
||||
var import_is_plain_object = require_is_plain_object();
|
||||
var VERSION = "8.1.6";
|
||||
function isPlainObject(value) {
|
||||
if (typeof value !== "object" || value === null)
|
||||
return false;
|
||||
if (Object.prototype.toString.call(value) !== "[object Object]")
|
||||
return false;
|
||||
const proto = Object.getPrototypeOf(value);
|
||||
if (proto === null)
|
||||
return true;
|
||||
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
||||
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
||||
}
|
||||
var import_request_error = require_dist_node4();
|
||||
function getBufferResponse(response) {
|
||||
return response.arrayBuffer();
|
||||
@@ -2821,7 +2831,7 @@ var require_dist_node5 = __commonJS({
|
||||
var _a, _b, _c;
|
||||
const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
|
||||
const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
|
||||
if ((0, import_is_plain_object.isPlainObject)(requestOptions.body) || Array.isArray(requestOptions.body)) {
|
||||
if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
|
||||
requestOptions.body = JSON.stringify(requestOptions.body);
|
||||
}
|
||||
let headers = {};
|
||||
@@ -2927,7 +2937,7 @@ var require_dist_node5 = __commonJS({
|
||||
async function getResponseData(response) {
|
||||
const contentType = response.headers.get("content-type");
|
||||
if (/application\/json/.test(contentType)) {
|
||||
return response.json();
|
||||
return response.json().catch(() => response.text()).catch(() => "");
|
||||
}
|
||||
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
|
||||
return response.text();
|
||||
@@ -10380,12 +10390,9 @@ async function main(appId2, privateKey2, owner2, repositories2, core2, createApp
|
||||
privateKey: privateKey2,
|
||||
request: request2
|
||||
});
|
||||
const appAuthentication = await auth({
|
||||
type: "app"
|
||||
});
|
||||
let authentication;
|
||||
if (parsedRepositoryNames) {
|
||||
authentication = await pRetry(() => getTokenFromRepository(request2, auth, parsedOwner, appAuthentication, parsedRepositoryNames), {
|
||||
authentication = await pRetry(() => getTokenFromRepository(request2, auth, parsedOwner, parsedRepositoryNames), {
|
||||
onFailedAttempt: (error) => {
|
||||
core2.info(
|
||||
`Failed to create token for "${parsedRepositoryNames}" (attempt ${error.attemptNumber}): ${error.message}`
|
||||
@@ -10394,7 +10401,7 @@ async function main(appId2, privateKey2, owner2, repositories2, core2, createApp
|
||||
retries: 3
|
||||
});
|
||||
} else {
|
||||
authentication = await pRetry(() => getTokenFromOwner(request2, auth, appAuthentication, parsedOwner), {
|
||||
authentication = await pRetry(() => getTokenFromOwner(request2, auth, parsedOwner), {
|
||||
onFailedAttempt: (error) => {
|
||||
core2.info(
|
||||
`Failed to create token for "${parsedOwner}" (attempt ${error.attemptNumber}): ${error.message}`
|
||||
@@ -10409,19 +10416,19 @@ async function main(appId2, privateKey2, owner2, repositories2, core2, createApp
|
||||
core2.saveState("token", authentication.token);
|
||||
}
|
||||
}
|
||||
async function getTokenFromOwner(request2, auth, appAuthentication, parsedOwner) {
|
||||
async function getTokenFromOwner(request2, auth, parsedOwner) {
|
||||
const response = await request2("GET /orgs/{org}/installation", {
|
||||
org: parsedOwner,
|
||||
headers: {
|
||||
authorization: `bearer ${appAuthentication.token}`
|
||||
request: {
|
||||
hook: auth.hook
|
||||
}
|
||||
}).catch((error) => {
|
||||
if (error.status !== 404)
|
||||
throw error;
|
||||
return request2("GET /users/{username}/installation", {
|
||||
username: parsedOwner,
|
||||
headers: {
|
||||
authorization: `bearer ${appAuthentication.token}`
|
||||
request: {
|
||||
hook: auth.hook
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -10431,12 +10438,12 @@ async function getTokenFromOwner(request2, auth, appAuthentication, parsedOwner)
|
||||
});
|
||||
return authentication;
|
||||
}
|
||||
async function getTokenFromRepository(request2, auth, parsedOwner, appAuthentication, parsedRepositoryNames) {
|
||||
async function getTokenFromRepository(request2, auth, parsedOwner, parsedRepositoryNames) {
|
||||
const response = await request2("GET /repos/{owner}/{repo}/installation", {
|
||||
owner: parsedOwner,
|
||||
repo: parsedRepositoryNames.split(",")[0],
|
||||
headers: {
|
||||
authorization: `bearer ${appAuthentication.token}`
|
||||
request: {
|
||||
hook: auth.hook
|
||||
}
|
||||
});
|
||||
const authentication = await auth({
|
||||
|
||||
Vendored
+14
-4
@@ -2811,8 +2811,18 @@ var require_dist_node5 = __commonJS({
|
||||
module2.exports = __toCommonJS2(dist_src_exports);
|
||||
var import_endpoint = require_dist_node2();
|
||||
var import_universal_user_agent = require_dist_node();
|
||||
var VERSION = "8.1.4";
|
||||
var import_is_plain_object = require_is_plain_object();
|
||||
var VERSION = "8.1.6";
|
||||
function isPlainObject(value) {
|
||||
if (typeof value !== "object" || value === null)
|
||||
return false;
|
||||
if (Object.prototype.toString.call(value) !== "[object Object]")
|
||||
return false;
|
||||
const proto = Object.getPrototypeOf(value);
|
||||
if (proto === null)
|
||||
return true;
|
||||
const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
||||
return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value);
|
||||
}
|
||||
var import_request_error = require_dist_node4();
|
||||
function getBufferResponse(response) {
|
||||
return response.arrayBuffer();
|
||||
@@ -2821,7 +2831,7 @@ var require_dist_node5 = __commonJS({
|
||||
var _a, _b, _c;
|
||||
const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;
|
||||
const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false;
|
||||
if ((0, import_is_plain_object.isPlainObject)(requestOptions.body) || Array.isArray(requestOptions.body)) {
|
||||
if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
|
||||
requestOptions.body = JSON.stringify(requestOptions.body);
|
||||
}
|
||||
let headers = {};
|
||||
@@ -2927,7 +2937,7 @@ var require_dist_node5 = __commonJS({
|
||||
async function getResponseData(response) {
|
||||
const contentType = response.headers.get("content-type");
|
||||
if (/application\/json/.test(contentType)) {
|
||||
return response.json();
|
||||
return response.json().catch(() => response.text()).catch(() => "");
|
||||
}
|
||||
if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
|
||||
return response.text();
|
||||
|
||||
+10
-14
@@ -70,15 +70,11 @@ export async function main(
|
||||
request,
|
||||
});
|
||||
|
||||
const appAuthentication = await auth({
|
||||
type: "app",
|
||||
});
|
||||
|
||||
let authentication;
|
||||
// If at least one repository is set, get installation ID from that repository
|
||||
|
||||
if (parsedRepositoryNames) {
|
||||
authentication = await pRetry(() => getTokenFromRepository(request, auth, parsedOwner,appAuthentication, parsedRepositoryNames), {
|
||||
authentication = await pRetry(() => getTokenFromRepository(request, auth, parsedOwner, parsedRepositoryNames), {
|
||||
onFailedAttempt: (error) => {
|
||||
core.info(
|
||||
`Failed to create token for "${parsedRepositoryNames}" (attempt ${error.attemptNumber}): ${error.message}`
|
||||
@@ -89,7 +85,7 @@ export async function main(
|
||||
|
||||
} else {
|
||||
// Otherwise get the installation for the owner, which can either be an organization or a user account
|
||||
authentication = await pRetry(() => getTokenFromOwner(request, auth, appAuthentication, parsedOwner), {
|
||||
authentication = await pRetry(() => getTokenFromOwner(request, auth, parsedOwner), {
|
||||
onFailedAttempt: (error) => {
|
||||
core.info(
|
||||
`Failed to create token for "${parsedOwner}" (attempt ${error.attemptNumber}): ${error.message}`
|
||||
@@ -110,12 +106,12 @@ export async function main(
|
||||
}
|
||||
}
|
||||
|
||||
async function getTokenFromOwner(request, auth, appAuthentication, parsedOwner) {
|
||||
async function getTokenFromOwner(request, auth, parsedOwner) {
|
||||
// https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#get-an-organization-installation-for-the-authenticated-app
|
||||
const response = await request("GET /orgs/{org}/installation", {
|
||||
org: parsedOwner,
|
||||
headers: {
|
||||
authorization: `bearer ${appAuthentication.token}`,
|
||||
request: {
|
||||
hook: auth.hook,
|
||||
},
|
||||
}).catch((error) => {
|
||||
/* c8 ignore next */
|
||||
@@ -124,8 +120,8 @@ async function getTokenFromOwner(request, auth, appAuthentication, parsedOwner)
|
||||
// https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-user-installation-for-the-authenticated-app
|
||||
return request("GET /users/{username}/installation", {
|
||||
username: parsedOwner,
|
||||
headers: {
|
||||
authorization: `bearer ${appAuthentication.token}`,
|
||||
request: {
|
||||
hook: auth.hook,
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -138,13 +134,13 @@ async function getTokenFromOwner(request, auth, appAuthentication, parsedOwner)
|
||||
return authentication;
|
||||
}
|
||||
|
||||
async function getTokenFromRepository(request, auth, parsedOwner,appAuthentication, parsedRepositoryNames) {
|
||||
async function getTokenFromRepository(request, auth, parsedOwner, parsedRepositoryNames) {
|
||||
// https://docs.github.com/rest/apps/apps?apiVersion=2022-11-28#get-a-repository-installation-for-the-authenticated-app
|
||||
const response = await request("GET /repos/{owner}/{repo}/installation", {
|
||||
owner: parsedOwner,
|
||||
repo: parsedRepositoryNames.split(",")[0],
|
||||
headers: {
|
||||
authorization: `bearer ${appAuthentication.token}`,
|
||||
request: {
|
||||
hook: auth.hook,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Generated
+134
-107
@@ -1,28 +1,29 @@
|
||||
{
|
||||
"name": "create-github-app-token",
|
||||
"version": "1.5.1",
|
||||
"version": "1.6.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "create-github-app-token",
|
||||
"version": "1.5.1",
|
||||
"version": "1.6.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.1",
|
||||
"@octokit/auth-app": "^6.0.1",
|
||||
"@octokit/request": "^8.1.4",
|
||||
"@octokit/request": "^8.1.6",
|
||||
"p-retry": "^6.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sinonjs/fake-timers": "^11.2.2",
|
||||
"ava": "^5.3.1",
|
||||
"c8": "^8.0.1",
|
||||
"dotenv": "^16.3.1",
|
||||
"esbuild": "^0.19.5",
|
||||
"esbuild": "^0.19.8",
|
||||
"execa": "^8.0.1",
|
||||
"open-cli": "^7.2.0",
|
||||
"undici": "^5.27.0",
|
||||
"yaml": "^2.3.3"
|
||||
"undici": "^5.28.2",
|
||||
"yaml": "^2.3.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/core": {
|
||||
@@ -227,9 +228,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.5.tgz",
|
||||
"integrity": "sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.8.tgz",
|
||||
"integrity": "sha512-31E2lxlGM1KEfivQl8Yf5aYU/mflz9g06H6S15ITUFQueMFtFjESRMoDSkvMo8thYvLBax+VKTPlpnx+sPicOA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -243,9 +244,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz",
|
||||
"integrity": "sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.8.tgz",
|
||||
"integrity": "sha512-B8JbS61bEunhfx8kasogFENgQfr/dIp+ggYXwTqdbMAgGDhRa3AaPpQMuQU0rNxDLECj6FhDzk1cF9WHMVwrtA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -259,9 +260,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.5.tgz",
|
||||
"integrity": "sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.8.tgz",
|
||||
"integrity": "sha512-rdqqYfRIn4jWOp+lzQttYMa2Xar3OK9Yt2fhOhzFXqg0rVWEfSclJvZq5fZslnz6ypHvVf3CT7qyf0A5pM682A==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -275,9 +276,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.5.tgz",
|
||||
"integrity": "sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.8.tgz",
|
||||
"integrity": "sha512-RQw9DemMbIq35Bprbboyf8SmOr4UXsRVxJ97LgB55VKKeJOOdvsIPy0nFyF2l8U+h4PtBx/1kRf0BelOYCiQcw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -291,9 +292,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.5.tgz",
|
||||
"integrity": "sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.8.tgz",
|
||||
"integrity": "sha512-3sur80OT9YdeZwIVgERAysAbwncom7b4bCI2XKLjMfPymTud7e/oY4y+ci1XVp5TfQp/bppn7xLw1n/oSQY3/Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -307,9 +308,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.5.tgz",
|
||||
"integrity": "sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.8.tgz",
|
||||
"integrity": "sha512-WAnPJSDattvS/XtPCTj1tPoTxERjcTpH6HsMr6ujTT+X6rylVe8ggxk8pVxzf5U1wh5sPODpawNicF5ta/9Tmw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -323,9 +324,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.5.tgz",
|
||||
"integrity": "sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.8.tgz",
|
||||
"integrity": "sha512-ICvZyOplIjmmhjd6mxi+zxSdpPTKFfyPPQMQTK/w+8eNK6WV01AjIztJALDtwNNfFhfZLux0tZLC+U9nSyA5Zg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -339,9 +340,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.5.tgz",
|
||||
"integrity": "sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.8.tgz",
|
||||
"integrity": "sha512-H4vmI5PYqSvosPaTJuEppU9oz1dq2A7Mr2vyg5TF9Ga+3+MGgBdGzcyBP7qK9MrwFQZlvNyJrvz6GuCaj3OukQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -355,9 +356,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.5.tgz",
|
||||
"integrity": "sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.8.tgz",
|
||||
"integrity": "sha512-z1zMZivxDLHWnyGOctT9JP70h0beY54xDDDJt4VpTX+iwA77IFsE1vCXWmprajJGa+ZYSqkSbRQ4eyLCpCmiCQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -371,9 +372,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.5.tgz",
|
||||
"integrity": "sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.8.tgz",
|
||||
"integrity": "sha512-1a8suQiFJmZz1khm/rDglOc8lavtzEMRo0v6WhPgxkrjcU0LkHj+TwBrALwoz/OtMExvsqbbMI0ChyelKabSvQ==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -387,9 +388,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.5.tgz",
|
||||
"integrity": "sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.8.tgz",
|
||||
"integrity": "sha512-fHZWS2JJxnXt1uYJsDv9+b60WCc2RlvVAy1F76qOLtXRO+H4mjt3Tr6MJ5l7Q78X8KgCFudnTuiQRBhULUyBKQ==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
@@ -403,9 +404,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.5.tgz",
|
||||
"integrity": "sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.8.tgz",
|
||||
"integrity": "sha512-Wy/z0EL5qZYLX66dVnEg9riiwls5IYnziwuju2oUiuxVc+/edvqXa04qNtbrs0Ukatg5HEzqT94Zs7J207dN5Q==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
@@ -419,9 +420,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.5.tgz",
|
||||
"integrity": "sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.8.tgz",
|
||||
"integrity": "sha512-ETaW6245wK23YIEufhMQ3HSeHO7NgsLx8gygBVldRHKhOlD1oNeNy/P67mIh1zPn2Hr2HLieQrt6tWrVwuqrxg==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -435,9 +436,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.5.tgz",
|
||||
"integrity": "sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.8.tgz",
|
||||
"integrity": "sha512-T2DRQk55SgoleTP+DtPlMrxi/5r9AeFgkhkZ/B0ap99zmxtxdOixOMI570VjdRCs9pE4Wdkz7JYrsPvsl7eESg==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@@ -451,9 +452,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.5.tgz",
|
||||
"integrity": "sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.8.tgz",
|
||||
"integrity": "sha512-NPxbdmmo3Bk7mbNeHmcCd7R7fptJaczPYBaELk6NcXxy7HLNyWwCyDJ/Xx+/YcNH7Im5dHdx9gZ5xIwyliQCbg==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -467,9 +468,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.5.tgz",
|
||||
"integrity": "sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.8.tgz",
|
||||
"integrity": "sha512-lytMAVOM3b1gPypL2TRmZ5rnXl7+6IIk8uB3eLsV1JwcizuolblXRrc5ShPrO9ls/b+RTp+E6gbsuLWHWi2zGg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -483,9 +484,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.5.tgz",
|
||||
"integrity": "sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.8.tgz",
|
||||
"integrity": "sha512-hvWVo2VsXz/8NVt1UhLzxwAfo5sioj92uo0bCfLibB0xlOmimU/DeAEsQILlBQvkhrGjamP0/el5HU76HAitGw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -499,9 +500,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.5.tgz",
|
||||
"integrity": "sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.8.tgz",
|
||||
"integrity": "sha512-/7Y7u77rdvmGTxR83PgaSvSBJCC2L3Kb1M/+dmSIvRvQPXXCuC97QAwMugBNG0yGcbEGfFBH7ojPzAOxfGNkwQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -515,9 +516,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.5.tgz",
|
||||
"integrity": "sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.8.tgz",
|
||||
"integrity": "sha512-9Lc4s7Oi98GqFA4HzA/W2JHIYfnXbUYgekUP/Sm4BG9sfLjyv6GKKHKKVs83SMicBF2JwAX6A1PuOLMqpD001w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -531,9 +532,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.5.tgz",
|
||||
"integrity": "sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.8.tgz",
|
||||
"integrity": "sha512-rq6WzBGjSzihI9deW3fC2Gqiak68+b7qo5/3kmB6Gvbh/NYPA0sJhrnp7wgV4bNwjqM+R2AApXGxMO7ZoGhIJg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -547,9 +548,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.5.tgz",
|
||||
"integrity": "sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.8.tgz",
|
||||
"integrity": "sha512-AIAbverbg5jMvJznYiGhrd3sumfwWs8572mIJL5NQjJa06P8KfCPWZQ0NwZbPQnbQi9OWSZhFVSUWjjIrn4hSw==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -563,9 +564,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz",
|
||||
"integrity": "sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.8.tgz",
|
||||
"integrity": "sha512-bfZ0cQ1uZs2PqpulNL5j/3w+GDhP36k1K5c38QdQg+Swy51jFZWWeIkteNsufkQxp986wnqRRsb/bHbY1WQ7TA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -777,14 +778,13 @@
|
||||
"integrity": "sha512-PclQ6JGMTE9iUStpzMkwLCISFn/wDeRjkZFIKALpvJQNBGwDoYYi2fFvuHwssoQ1rXI5mfh6jgTgWuddeUzfWw=="
|
||||
},
|
||||
"node_modules/@octokit/request": {
|
||||
"version": "8.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.1.4.tgz",
|
||||
"integrity": "sha512-M0aaFfpGPEKrg7XoA/gwgRvc9MSXHRO2Ioki1qrPDbl1e9YhjIwVoHE7HIKmv/m3idzldj//xBujcFNqGX6ENA==",
|
||||
"version": "8.1.6",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-8.1.6.tgz",
|
||||
"integrity": "sha512-YhPaGml3ncZC1NfXpP3WZ7iliL1ap6tLkAp6MvbK2fTTPytzVUyUesBBogcdMm86uRYO5rHaM1xIWxigWZ17MQ==",
|
||||
"dependencies": {
|
||||
"@octokit/endpoint": "^9.0.0",
|
||||
"@octokit/request-error": "^5.0.0",
|
||||
"@octokit/types": "^12.0.0",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -812,6 +812,24 @@
|
||||
"@octokit/openapi-types": "^19.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@sinonjs/commons": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz",
|
||||
"integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"type-detect": "4.0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/@sinonjs/fake-timers": {
|
||||
"version": "11.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-11.2.2.tgz",
|
||||
"integrity": "sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@sinonjs/commons": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@tokenizer/token": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@tokenizer/token/-/token-0.3.0.tgz",
|
||||
@@ -1847,9 +1865,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.19.5",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.5.tgz",
|
||||
"integrity": "sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==",
|
||||
"version": "0.19.8",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.8.tgz",
|
||||
"integrity": "sha512-l7iffQpT2OrZfH2rXIp7/FkmaeZM0vxbxN9KfiCwGYuZqzMg/JdvX26R31Zxn/Pxvsrg3Y9N6XTcnknqDyyv4w==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"bin": {
|
||||
@@ -1859,28 +1877,28 @@
|
||||
"node": ">=12"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/android-arm": "0.19.5",
|
||||
"@esbuild/android-arm64": "0.19.5",
|
||||
"@esbuild/android-x64": "0.19.5",
|
||||
"@esbuild/darwin-arm64": "0.19.5",
|
||||
"@esbuild/darwin-x64": "0.19.5",
|
||||
"@esbuild/freebsd-arm64": "0.19.5",
|
||||
"@esbuild/freebsd-x64": "0.19.5",
|
||||
"@esbuild/linux-arm": "0.19.5",
|
||||
"@esbuild/linux-arm64": "0.19.5",
|
||||
"@esbuild/linux-ia32": "0.19.5",
|
||||
"@esbuild/linux-loong64": "0.19.5",
|
||||
"@esbuild/linux-mips64el": "0.19.5",
|
||||
"@esbuild/linux-ppc64": "0.19.5",
|
||||
"@esbuild/linux-riscv64": "0.19.5",
|
||||
"@esbuild/linux-s390x": "0.19.5",
|
||||
"@esbuild/linux-x64": "0.19.5",
|
||||
"@esbuild/netbsd-x64": "0.19.5",
|
||||
"@esbuild/openbsd-x64": "0.19.5",
|
||||
"@esbuild/sunos-x64": "0.19.5",
|
||||
"@esbuild/win32-arm64": "0.19.5",
|
||||
"@esbuild/win32-ia32": "0.19.5",
|
||||
"@esbuild/win32-x64": "0.19.5"
|
||||
"@esbuild/android-arm": "0.19.8",
|
||||
"@esbuild/android-arm64": "0.19.8",
|
||||
"@esbuild/android-x64": "0.19.8",
|
||||
"@esbuild/darwin-arm64": "0.19.8",
|
||||
"@esbuild/darwin-x64": "0.19.8",
|
||||
"@esbuild/freebsd-arm64": "0.19.8",
|
||||
"@esbuild/freebsd-x64": "0.19.8",
|
||||
"@esbuild/linux-arm": "0.19.8",
|
||||
"@esbuild/linux-arm64": "0.19.8",
|
||||
"@esbuild/linux-ia32": "0.19.8",
|
||||
"@esbuild/linux-loong64": "0.19.8",
|
||||
"@esbuild/linux-mips64el": "0.19.8",
|
||||
"@esbuild/linux-ppc64": "0.19.8",
|
||||
"@esbuild/linux-riscv64": "0.19.8",
|
||||
"@esbuild/linux-s390x": "0.19.8",
|
||||
"@esbuild/linux-x64": "0.19.8",
|
||||
"@esbuild/netbsd-x64": "0.19.8",
|
||||
"@esbuild/openbsd-x64": "0.19.8",
|
||||
"@esbuild/sunos-x64": "0.19.8",
|
||||
"@esbuild/win32-arm64": "0.19.8",
|
||||
"@esbuild/win32-ia32": "0.19.8",
|
||||
"@esbuild/win32-x64": "0.19.8"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
@@ -4090,6 +4108,15 @@
|
||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||
}
|
||||
},
|
||||
"node_modules/type-detect": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
|
||||
"integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/type-fest": {
|
||||
"version": "0.13.1",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz",
|
||||
@@ -4103,9 +4130,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici": {
|
||||
"version": "5.27.0",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.27.0.tgz",
|
||||
"integrity": "sha512-l3ydWhlhOJzMVOYkymLykcRRXqbUaQriERtR70B9LzNkZ4bX52Fc8wbTDneMiwo8T+AemZXvXaTx+9o5ROxrXg==",
|
||||
"version": "5.28.2",
|
||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.2.tgz",
|
||||
"integrity": "sha512-wh1pHJHnUeQV5Xa8/kyQhO7WFa8M34l026L5P/+2TYiakvGy5Rdc8jWZVyG7ieht/0WgJLEd3kcU5gKx+6GC8w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@fastify/busboy": "^2.0.0"
|
||||
@@ -4329,9 +4356,9 @@
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
||||
},
|
||||
"node_modules/yaml": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.3.tgz",
|
||||
"integrity": "sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==",
|
||||
"version": "2.3.4",
|
||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz",
|
||||
"integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
|
||||
+6
-5
@@ -2,7 +2,7 @@
|
||||
"name": "create-github-app-token",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "1.6.0",
|
||||
"version": "1.6.2",
|
||||
"description": "GitHub Action for creating a GitHub App Installation Access Token",
|
||||
"scripts": {
|
||||
"build": "esbuild main.js post.js --bundle --outdir=dist --out-extension:.js=.cjs --platform=node --target=node20.0.0",
|
||||
@@ -14,18 +14,19 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.1",
|
||||
"@octokit/auth-app": "^6.0.1",
|
||||
"@octokit/request": "^8.1.4",
|
||||
"@octokit/request": "^8.1.6",
|
||||
"p-retry": "^6.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sinonjs/fake-timers": "^11.2.2",
|
||||
"ava": "^5.3.1",
|
||||
"c8": "^8.0.1",
|
||||
"dotenv": "^16.3.1",
|
||||
"esbuild": "^0.19.5",
|
||||
"esbuild": "^0.19.8",
|
||||
"execa": "^8.0.1",
|
||||
"open-cli": "^7.2.0",
|
||||
"undici": "^5.27.0",
|
||||
"yaml": "^2.3.3"
|
||||
"undici": "^5.28.2",
|
||||
"yaml": "^2.3.4"
|
||||
},
|
||||
"release": {
|
||||
"branches": [
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
import { test } from "./main.js";
|
||||
|
||||
import { install } from "@sinonjs/fake-timers";
|
||||
|
||||
// Verify `main` retry when the clock has drifted.
|
||||
await test((mockPool) => {
|
||||
process.env.INPUT_OWNER = 'actions'
|
||||
process.env.INPUT_REPOSITORIES = 'failed-repo';
|
||||
const owner = process.env.INPUT_OWNER
|
||||
const repo = process.env.INPUT_REPOSITORIES
|
||||
const mockInstallationId = "123456";
|
||||
|
||||
install({ now: 0, toFake: ["Date"] });
|
||||
|
||||
mockPool
|
||||
.intercept({
|
||||
path: `/repos/${owner}/${repo}/installation`,
|
||||
method: "GET",
|
||||
headers: {
|
||||
accept: "application/vnd.github.v3+json",
|
||||
"user-agent": "actions/create-github-app-token",
|
||||
// Intentionally omitting the `authorization` header, since JWT creation is not idempotent.
|
||||
},
|
||||
})
|
||||
.reply(({ headers }) => {
|
||||
const [_, jwt] = (headers.authorization || "").split(" ");
|
||||
const payload = JSON.parse(Buffer.from(jwt.split(".")[1], "base64").toString());
|
||||
|
||||
if (payload.iat < 0) {
|
||||
return {
|
||||
statusCode: 401,
|
||||
data: {
|
||||
message: "'Issued at' claim ('iat') must be an Integer representing the time that the assertion was issued."
|
||||
},
|
||||
responseOptions: {
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
"date": new Date(Date.now() + 30000).toUTCString()
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
statusCode: 200,
|
||||
data: {
|
||||
id: mockInstallationId
|
||||
},
|
||||
responseOptions: {
|
||||
headers: {
|
||||
"content-type": "application/json"
|
||||
}
|
||||
}
|
||||
};
|
||||
}).times(2);
|
||||
});
|
||||
Reference in New Issue
Block a user