Skip to content

Commit f0a437d

Browse files
Workflow/close failed prs (#6960)
* chore: add workflow to close stale PRs with failed workflows * Include workflow failures when closing stale PRs * Filter meaningful commits to only include those within the last 14 days
1 parent 100462d commit f0a437d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/close-failed-prs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ jobs:
5959
6060
const meaningfulCommits = commits.filter(c => {
6161
const msg = c.commit.message.toLowerCase();
62+
const date = new Date(c.commit.committer.date);
6263
const isMergeFromMain = mainBranches.some(branch =>
6364
msg.startsWith(`merge branch '${branch}'`) ||
6465
msg.includes(`merge remote-tracking branch '${branch}'`)
6566
);
66-
return !isMergeFromMain;
67+
68+
return !isMergeFromMain && date > cutoff;
6769
});
6870
6971
// Get checks with error handling
@@ -151,4 +153,4 @@ jobs:
151153
} catch (error) {
152154
console.error(`❌ Fatal error: ${error.message}`);
153155
throw error;
154-
}
156+
}

0 commit comments

Comments
 (0)