diff --git a/__tests__/main.test.ts b/__tests__/main.test.ts index 3493d53..7c71e57 100644 --- a/__tests__/main.test.ts +++ b/__tests__/main.test.ts @@ -361,7 +361,7 @@ test.serial( ' Successfully remove multiple deployments only and not remove envi console.log( `\n` ) for ( let i = 1; i <= deployAmt; i++ ) -{ + { await createDeploymentWithStatus( octokit, environment, { ...context, ref } ) console.log( ` › ➕ Create test deployment for multitest › \x1b[38;5;13mref ${ ref }\x1b[0m` ) await delay( delayAmt ) @@ -456,7 +456,7 @@ test.serial( ' Successfully deleted limited results', console.log( `\n` ) for ( let i = 1; i <= deployAmt; i++ ) -{ + { await createDeploymentWithStatus( octokit, environment, { ...context, ref } ) console.log( ` › ➕ Create test deployment for multitest › \x1b[38;5;13mref ${ ref }\x1b[0m` ) await delay( delayAmt ) diff --git a/dist/index.js b/dist/index.js index 782a9ad..d643744 100644 --- a/dist/index.js +++ b/dist/index.js @@ -88,6 +88,9 @@ function listDeployments(client, { owner, repo, environment, ref = '', limit = 1 return deploymentRefs.concat(yield listDeployments(client, { owner, repo, environment, ref, limit }, page + 1)); } } + else if (limit !== 100) { + (0, core_1.info)(` › ⚙️ Using custom limit of \x1b[38;5;1m${limit}\x1b[0m › not using pagination`); + } /* Done getting items, return deployment list */ @@ -100,7 +103,7 @@ function listDeployments(client, { owner, repo, environment, ref = '', limit = 1 */ function setDeploymentInactive(client, { owner, repo, deploymentId }) { return __awaiter(this, void 0, void 0, function* () { - (0, core_1.info)(` › ✔️ ID \x1b[38;5;8m${deploymentId}\x1b[0m inactive`); + (0, core_1.info)(` › ✔️ ID \x1b[38;5;244m${deploymentId}\x1b[0m inactive`); yield client.request('POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses', { owner, repo, @@ -114,7 +117,7 @@ function setDeploymentInactive(client, { owner, repo, deploymentId }) { */ function deleteDeploymentById(client, { owner, repo, deploymentId }) { return __awaiter(this, void 0, void 0, function* () { - (0, core_1.info)(` › ✔️ ID \x1b[38;5;8m${deploymentId}\x1b[0m deleted`); + (0, core_1.info)(` › ✔️ ID \x1b[38;5;244m${deploymentId}\x1b[0m deleted`); yield client.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', { owner, repo, diff --git a/lib/execute.js b/lib/execute.js index 1a9b74a..1a41204 100644 --- a/lib/execute.js +++ b/lib/execute.js @@ -81,6 +81,9 @@ function listDeployments(client, { owner, repo, environment, ref = '', limit = 1 return deploymentRefs.concat(yield listDeployments(client, { owner, repo, environment, ref, limit }, page + 1)); } } + else if (limit !== 100) { + (0, core_1.info)(` › ⚙️ Using custom limit of \x1b[38;5;1m${limit}\x1b[0m › not using pagination`); + } /* Done getting items, return deployment list */ @@ -93,7 +96,7 @@ function listDeployments(client, { owner, repo, environment, ref = '', limit = 1 */ function setDeploymentInactive(client, { owner, repo, deploymentId }) { return __awaiter(this, void 0, void 0, function* () { - (0, core_1.info)(` › ✔️ ID \x1b[38;5;8m${deploymentId}\x1b[0m inactive`); + (0, core_1.info)(` › ✔️ ID \x1b[38;5;244m${deploymentId}\x1b[0m inactive`); yield client.request('POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses', { owner, repo, @@ -107,7 +110,7 @@ function setDeploymentInactive(client, { owner, repo, deploymentId }) { */ function deleteDeploymentById(client, { owner, repo, deploymentId }) { return __awaiter(this, void 0, void 0, function* () { - (0, core_1.info)(` › ✔️ ID \x1b[38;5;8m${deploymentId}\x1b[0m deleted`); + (0, core_1.info)(` › ✔️ ID \x1b[38;5;244m${deploymentId}\x1b[0m deleted`); yield client.request('DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', { owner, repo, diff --git a/lib/execute.js.map b/lib/execute.js.map index e554406..85deff5 100644 --- a/lib/execute.js.map +++ b/lib/execute.js.map @@ -1 +1 @@ -{"version":3,"file":"execute.js","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA+B;AAC/B,wCAAgE;AAChE,wDAAyC;AASzC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iB,EACtB;gBACI,MAAM,oBAAoB,CAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,IAAI,CAAE,CAAA;aAClE;YAED,IAAA,WAAI,EAAE,uCAAuC,CAAE,CAAA;SAElD;QACD,OAAQ,GAAG,EACX;YACI,IAAA,gBAAS,EAAI,GAAqB,CAAC,OAAO,CAAE,CAAA;SAC/C;IACL,CAAC;CAAA;AA3ID,oBA2IC"} \ No newline at end of file diff --git a/src/execute.ts b/src/execute.ts index a266bde..c79ffd2 100644 --- a/src/execute.ts +++ b/src/execute.ts @@ -46,7 +46,7 @@ async function listDeployments( client: Octokit, { owner, repo, environment, ref const itemsTotal = deploymentRefs.length if ( !limit || limit === 100 ) -{ + { info( ` › ⚙️ Using default limit of \x1b[38;5;1m${ limit }\x1b[0m` ) if ( itemsTotal === 100 ) return deploymentRefs.concat( await listDeployments( client, { owner, repo, environment, ref, limit }, page + 1 ) ) @@ -56,8 +56,8 @@ async function listDeployments( client: Octokit, { owner, repo, environment, ref */ } - else if ( limit >= 100 ) -{ + else if ( limit >= 100 ) + { const pagesNeeded = Math.ceil( limit / 100 ) /* @@ -66,11 +66,15 @@ async function listDeployments( client: Octokit, { owner, repo, environment, ref */ if ( itemsTotal < limit && page < pagesNeeded ) -{ + { info( ` › ⚙️ Using custom limit of \x1b[38;5;1m${ limit }\x1b[0m › reading page \x1b[38;5;32mpage ${ page }/${ pagesNeeded }\x1b[0m` ) return deploymentRefs.concat( await listDeployments( client, { owner, repo, environment, ref, limit }, page + 1 ) ) } } + else if ( limit !== 100 ) + { + info( ` › ⚙️ Using custom limit of \x1b[38;5;1m${ limit }\x1b[0m › not using pagination` ) + } /* Done getting items, return deployment list @@ -87,7 +91,7 @@ async function listDeployments( client: Octokit, { owner, repo, environment, ref async function setDeploymentInactive( client: Octokit, { owner, repo, deploymentId }: Deployment ): Promise < void > { - info( ` › ✔️ ID \x1b[38;5;8m${ deploymentId }\x1b[0m inactive` ) + info( ` › ✔️ ID \x1b[38;5;244m${ deploymentId }\x1b[0m inactive` ) await client.request( 'POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses', { owner, @@ -103,7 +107,7 @@ async function setDeploymentInactive( client: Octokit, { owner, repo, deployment async function deleteDeploymentById( client: Octokit, { owner, repo, deploymentId }: Deployment ): Promise < void > { - info( ` › ✔️ ID \x1b[38;5;8m${ deploymentId }\x1b[0m deleted` ) + info( ` › ✔️ ID \x1b[38;5;244m${ deploymentId }\x1b[0m deleted` ) await client.request( 'DELETE /repos/{owner}/{repo}/deployments/{deployment_id}', { owner,