Skip to content
6 changes: 4 additions & 2 deletions .github/workflows/close-failed-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -151,4 +153,4 @@ jobs:
} catch (error) {
console.error(`❌ Fatal error: ${error.message}`);
throw error;
}
}