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

This commit is contained in:
Shahed Nasser
2024-01-22 19:02:08 +02:00
committed by GitHub
parent 8c67e32d41
commit 85dad169bb

View File

@@ -73,14 +73,15 @@ async function scanDirectory(startPath: string) {
commitResponse.data[0].commit.committer.date
)
const monthsSinceEdited = getMonthDifference(lastEditedDate, today)
const monthsThreshold = 2
if (monthsSinceEdited > 6) {
if (monthsSinceEdited > monthsThreshold) {
//file was edited more than 6 months ago.
//check if there's an issue created for this file since the commit date
const existingIssue = await linearClient.issues({
filter: {
createdAt: {
gte: subtractMonths(monthsSinceEdited - 6, today),
gte: subtractMonths(monthsSinceEdited - monthsThreshold, today),
},
title: {
containsIgnoreCase: `Freshness check for ${filePath}`,