diff --git a/dist/index.js b/dist/index.js index c13e8f9..c2a3f1e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -31632,19 +31632,16 @@ const core = __importStar(__nccwpck_require__(2186)); const date_fns_1 = __nccwpck_require__(3314); function processBranch(plan, branch, commitComments, params) { return __awaiter(this, void 0, void 0, function* () { + console.log("-> branch was last updated by " + branch.username + " on " + branch.date); if (plan.action === "skip") { console.log(plan.reason); return; } - if (plan.action === "keep stale") { - console.log("Branch was marked stale on " + (0, formatISO_1.default)(plan.lastCommentTime)); - console.log("It will be removed on " + (0, formatISO_1.default)(plan.cutoffTime)); - return; - } if (plan.action === "mark stale") { - console.log("Marking branch as stale"); - console.log("It will be removed on " + (0, formatISO_1.default)(plan.cutoffTime)); + console.log("-> branch will be removed on " + (0, formatISO_1.default)(plan.cutoffTime)); + console.log("-> marking branch as stale"); if (params.isDryRun) { + console.log("-> (doing nothing because of dry run flag)"); return; } const commentTag = "stale:" + branch.branchName; @@ -31654,11 +31651,16 @@ function processBranch(plan, branch, commitComments, params) { commentBody: commitComments_1.TaggedCommitComments.formatCommentMessage(params.staleCommentMessage, branch, params, params.repo), }); } + console.log("-> branch was marked stale on " + plan.lastCommentTime); + if (plan.action === "keep stale") { + console.log("-> branch will be removed on " + (0, formatISO_1.default)(plan.cutoffTime)); + return; + } if (plan.action === "remove") { - console.log("-> 🗑️ removing stale branch (stale comment date is " + - (0, formatISO_1.default)(plan.lastCommentTime) + - " and cut-off is " + (0, formatISO_1.default)(plan.cutoffTime) + ')'); + console.log("-> branch was slated for deletion on " + plan.cutoffTime); + console.log("-> removing branch"); if (params.isDryRun) { + console.log("-> (doing nothing because of dry run flag)"); return; } commitComments.deleteBranch(branch); diff --git a/package.json b/package.json index 4fa47c0..5978c2d 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "remove-stale-branches", "private": true, - "version": "1.5.1", + "version": "1.5.2", "description": "Cleanup stale branches from a repository", "main": "src/index.ts", "author": "Francois Picalausa ", diff --git a/src/removeStaleBranches.ts b/src/removeStaleBranches.ts index cde897b..8897f38 100644 --- a/src/removeStaleBranches.ts +++ b/src/removeStaleBranches.ts @@ -21,28 +21,23 @@ async function processBranch( commitComments: TaggedCommitComments, params: Params ) { + console.log( + "-> branch was last updated by " + branch.username + " on " + branch.date); + if (plan.action === "skip") { console.log(plan.reason); return; } - if (plan.action === "keep stale") { - console.log( - "Branch was marked stale on " + formatISO(plan.lastCommentTime) - ); - console.log( - "It will be removed on " + formatISO(plan.cutoffTime) - ); - return; - } if (plan.action === "mark stale") { - console.log("Marking branch as stale"); console.log( - "It will be removed on " + formatISO(plan.cutoffTime) + "-> branch will be removed on " + formatISO(plan.cutoffTime) ); + console.log("-> marking branch as stale"); if (params.isDryRun) { + console.log("-> (doing nothing because of dry run flag)"); return; } @@ -59,14 +54,21 @@ async function processBranch( }); } - if (plan.action === "remove") { + console.log( + "-> branch was marked stale on " + plan.lastCommentTime); + + if (plan.action === "keep stale") { console.log( - "-> 🗑️ removing stale branch (stale comment date is " + - formatISO(plan.lastCommentTime) + - " and cut-off is " + formatISO(plan.cutoffTime) + ')' + "-> branch will be removed on " + formatISO(plan.cutoffTime) ); + return; + } + if (plan.action === "remove") { + console.log("-> branch was slated for deletion on " + plan.cutoffTime); + console.log("-> removing branch"); if (params.isDryRun) { + console.log("-> (doing nothing because of dry run flag)"); return; }