From 72c660687e50a8c34eb3958e5b933d7de5f7b3d7 Mon Sep 17 00:00:00 2001 From: OnkarRuikar <87750369+OnkarRuikar@users.noreply.github.com> Date: Fri, 6 Sep 2024 21:00:35 +0530 Subject: [PATCH] fix(ci): ignore deleted file in log-url-isuses script --- scripts/log-url-issues.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/log-url-issues.js b/scripts/log-url-issues.js index d07581275413f58..61d26f7df85c26c 100644 --- a/scripts/log-url-issues.js +++ b/scripts/log-url-issues.js @@ -123,9 +123,11 @@ function getFragmentDetails(fromStaging = true) { .filter((header) => !addedFragments.includes(header)) .filter((header) => { // check if another header with same name exists in the file - const headerAnchors = getFileAnchors( - `${rootDir}/files/en-us/${path}/index.md`, - ); + const absPath = `${rootDir}/files/en-us/${path}/index.md`; + if (!fs.existsSync(absPath)) { + return true; + } + const headerAnchors = getFileAnchors(absPath); return !headerAnchors.includes(header); }) .forEach((header) => {