From e1b80d206099c500cea28c181d5d344cc97d34d3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 06:27:09 +0000 Subject: [PATCH] refactor: remove redundant fs require inside arrow function The fs module is already imported at the top of the file (line 18). The inner arrow function in recomputeHashWithDebugLogging() was re-requiring it unnecessarily. The closure already has access to the outer fs binding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- actions/setup/js/check_workflow_timestamp_api.cjs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/actions/setup/js/check_workflow_timestamp_api.cjs b/actions/setup/js/check_workflow_timestamp_api.cjs index 09b40e2723c..fd0cc1d118c 100644 --- a/actions/setup/js/check_workflow_timestamp_api.cjs +++ b/actions/setup/js/check_workflow_timestamp_api.cjs @@ -314,10 +314,7 @@ async function main() { if (localMdFilePath.startsWith(allowedDir + path.sep)) { core.info(" Using local filesystem file reader for debug pass"); // defaultFileReader is the built-in fs-based reader; wrap it as async - fileReader = async filePath => { - const fs = require("fs"); - return fs.readFileSync(filePath, "utf8"); - }; + fileReader = async filePath => fs.readFileSync(filePath, "utf8"); // Override workflowMdPath to the resolved local path for this pass await computeFrontmatterHash(localMdFilePath, { fileReader, verbose: true }); core.info("═══ End of debug hash recomputation ═══");