mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-12-19 07:00:35 +08:00
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
This commit is contained in:
6
.github/workflows/close-failed-prs.yml
vendored
6
.github/workflows/close-failed-prs.yml
vendored
@@ -59,11 +59,13 @@ jobs:
|
||||
|
||||
const meaningfulCommits = commits.filter(c => {
|
||||
const msg = c.commit.message.toLowerCase();
|
||||
const date = new Date(c.commit.committer.date);
|
||||
const isMergeFromMain = mainBranches.some(branch =>
|
||||
msg.startsWith(`merge branch '${branch}'`) ||
|
||||
msg.includes(`merge remote-tracking branch '${branch}'`)
|
||||
);
|
||||
return !isMergeFromMain;
|
||||
|
||||
return !isMergeFromMain && date > cutoff;
|
||||
});
|
||||
|
||||
// Get checks with error handling
|
||||
@@ -151,4 +153,4 @@ jobs:
|
||||
} catch (error) {
|
||||
console.error(`❌ Fatal error: ${error.message}`);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user