chore(docs-util): change freshness check threshold (#6122)

This commit is contained in:
Shahed Nasser
2024-01-22 18:02:08 +01:00
committed by GitHub
parent 8c67e32d41
commit 85dad169bb
@@ -73,14 +73,15 @@ async function scanDirectory(startPath: string) {
commitResponse.data[0].commit.committer.date commitResponse.data[0].commit.committer.date
) )
const monthsSinceEdited = getMonthDifference(lastEditedDate, today) const monthsSinceEdited = getMonthDifference(lastEditedDate, today)
const monthsThreshold = 2
if (monthsSinceEdited > 6) { if (monthsSinceEdited > monthsThreshold) {
//file was edited more than 6 months ago. //file was edited more than 6 months ago.
//check if there's an issue created for this file since the commit date //check if there's an issue created for this file since the commit date
const existingIssue = await linearClient.issues({ const existingIssue = await linearClient.issues({
filter: { filter: {
createdAt: { createdAt: {
gte: subtractMonths(monthsSinceEdited - 6, today), gte: subtractMonths(monthsSinceEdited - monthsThreshold, today),
}, },
title: { title: {
containsIgnoreCase: `Freshness check for ${filePath}`, containsIgnoreCase: `Freshness check for ${filePath}`,