Skip to content

Commit

Permalink
chore: build action
Browse files Browse the repository at this point in the history
  • Loading branch information
fpicalausa committed May 24, 2022
1 parent 0b126ce commit 15cf33a
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31632,7 +31632,10 @@ 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);
console.log("-> branch was last updated by " +
branch.username +
" on " +
(0, formatISO_1.default)(branch.date));
if (plan.action === "skip") {
console.log(plan.reason);
return;
Expand All @@ -31651,13 +31654,13 @@ 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);
console.log("-> branch was marked stale on " + (0, formatISO_1.default)(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("-> branch was slated for deletion on " + plan.cutoffTime);
console.log("-> branch was slated for deletion on " + (0, formatISO_1.default)(plan.cutoffTime));
console.log("-> removing branch");
if (params.isDryRun) {
console.log("-> (doing nothing because of dry run flag)");
Expand Down Expand Up @@ -31715,9 +31718,18 @@ function planBranchAction(now, branch, filters, commitComments, params) {
}, 0);
const cutoffTime = (0, date_fns_1.addDays)(latestStaleComment, params.daysBeforeBranchDelete).getTime();
if (latestStaleComment <= filters.removeCutoff) {
return { action: "keep stale", cutoffTime, lastCommentTime: latestStaleComment };
return {
action: "keep stale",
cutoffTime,
lastCommentTime: latestStaleComment,
};
}
return { action: "remove", comments, cutoffTime, lastCommentTime: latestStaleComment };
return {
action: "remove",
comments,
cutoffTime,
lastCommentTime: latestStaleComment,
};
});
}
function removeStaleBranches(octokit, params) {
Expand All @@ -31738,10 +31750,7 @@ function removeStaleBranches(octokit, params) {
const branchRegex = params.protectedBranchesRegex
? new RegExp(params.protectedBranchesRegex)
: null;
const repo = {
repo: params.repo.repo,
owner: params.repo.owner,
};
const repo = params.repo;
const filters = {
staleCutoff,
authorsRegex,
Expand Down

0 comments on commit 15cf33a

Please sign in to comment.