Skip to content

Commit

Permalink
feat: group output for each branch
Browse files Browse the repository at this point in the history
  • Loading branch information
fpicalausa committed May 17, 2022
1 parent 744a38a commit 506c92b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/removeStaleBranches.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import core from "@actions/core";
import { Octokit } from "@octokit/core";
import formatISO from "date-fns/formatISO";
import subDays from "date-fns/subDays";
Expand All @@ -18,7 +19,7 @@ async function removeOrNotifyStaleBranch(
});

if (comments.length == 0) {
console.log("-> marking as stale");
console.log("-> ✍️ marking as stale");
if (params.isDryRun) {
return;
}
Expand Down Expand Up @@ -50,7 +51,7 @@ async function removeOrNotifyStaleBranch(
}

console.log(
"-> removing stale branch (stale comment date is " +
"-> 🗑️ removing stale branch (stale comment date is " +
formatISO(latestStaleComment) +
")"
);
Expand Down Expand Up @@ -80,8 +81,6 @@ async function processBranch(
commitComments: TaggedCommitComments,
params: Params
) {
console.log("Looking at branch " + branch.branchName);

if (params.protectedOrganizationName && branch.belongsToOrganization) {
console.log(
"-> author " +
Expand Down Expand Up @@ -167,8 +166,13 @@ export async function removeStaleBranches(
repo,
params.protectedOrganizationName
)) {
if (await processBranch(branch, filters, commitComments, params)) {
operations++;
core.startGroup("Inspecting branch " + branch.branchName);
try {
if (await processBranch(branch, filters, commitComments, params)) {
operations++;
}
} finally {
core.endGroup();
}

if (operations >= params.operationsPerRun) {
Expand Down

0 comments on commit 506c92b

Please sign in to comment.