From 4937eb43c071a69f5f8898e008d79dae747a90a9 Mon Sep 17 00:00:00 2001 From: Josh Johanning Date: Fri, 22 Aug 2025 22:02:59 -0500 Subject: [PATCH] feat: add bash syntax checking for .sh files in lint-readme script --- .github/scripts/lint-readme.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/scripts/lint-readme.js b/.github/scripts/lint-readme.js index 7d9c0cf..fd72f12 100644 --- a/.github/scripts/lint-readme.js +++ b/.github/scripts/lint-readme.js @@ -77,6 +77,21 @@ allScripts.forEach(file => { } }); +// Check bash syntax for all .sh files +allScripts.forEach(file => { + if (!file.endsWith('.sh')) { + return; + } + + const filePath = path.join(directoryPath, file); + try { + execSync(`bash -n "${filePath}"`, { stdio: 'pipe' }); + } catch (error) { + console.log(`Bash syntax error in ${file}: ${error.stderr.toString().trim()}`); + issueCount++; + } +}); + // Extract the part of the README under the ## Scripts heading const scriptsSection = readme.split(`${parentHeading}\n`)[1];