Skip to content

Commit

Permalink
Update index.js (#7383)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkeirstead authored Oct 2, 2024
1 parent 56fa498 commit 7fed5e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/actions/learning-path-staleness-check/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function UpdateModifiedFiles(fileName, path, learningPathFile)
{
modifiedFilesUrlToFileName[path] = fileName;

modifiedFilesPathToLearningPathFile[path] = modifiedFilesPathToLearningPathFile[path] ? modifiedFilesPathToLearningPathFile[path] : new Set();;
modifiedFilesPathToLearningPathFile[path] = modifiedFilesPathToLearningPathFile[path] ? modifiedFilesPathToLearningPathFile[path] : new Set();
modifiedFilesPathToLearningPathFile[path].add(learningPathFile);

modifiedFiles = new Set();
Expand Down Expand Up @@ -183,10 +183,10 @@ function ValidateLinks(learningPathContents, repoURLToSearch, modifiedPRFiles, l
}
else if (headContentLines.length < oldLineNumber || prevContentLines[oldLineNumber - 1].trim() !== headContentLines[oldLineNumber - 1].trim())
{
const newLineNumberLast = headContentLines.lastIndexOf(prevContentLines[oldLineNumber - 1]) + 1;
const newLineNumberFirst = headContentLines.indexOf(prevContentLines[oldLineNumber - 1]) + 1;
const newLineNumberLast = headContentLines.lastIndexOf(prevContentLines[oldLineNumber - 1].trim()) + 1;
const newLineNumberFirst = headContentLines.indexOf(prevContentLines[oldLineNumber - 1].trim()) + 1;

if (newLineNumberLast !== newLineNumberFirst) // Multiple matches found in the file
if (newLineNumberLast === 0 || newLineNumberFirst === 0 || newLineNumberLast !== newLineNumberFirst) // Multiple matches found in the file, or no matches found
{
UpdateManuallyReview(fileName, link, learningPathFile, learningPathLineNumber, oldLineNumber);
}
Expand Down

0 comments on commit 7fed5e6

Please sign in to comment.