fix(ci): normalize shell validation input (fixes #3)
ForgeFlow quality gate / quality (pull_request) Successful in 7m26s
Managed validation / full (pull_request) Canceled after 0s
ForgeFlow quality gate / secret-scan (pull_request) Successful in 6s

This commit is contained in:
NuklearRabbit
2026-08-29 02:30:19 +02:00
parent 79dc6d367b
commit 408dea0c2d
3 changed files with 18 additions and 18 deletions
+5 -1
View File
@@ -1,3 +1,4 @@
const fs = require('node:fs');
const path = require('node:path');
function normalizeRelativePosixPath(value) {
@@ -19,11 +20,14 @@ function bashSyntaxCheckInvocation(root, scriptPath = 'examples/server/forgeflow
if (typeof root !== 'string' || !root.trim()) {
throw new Error('Project root is required for shell validation.');
}
const relativeScriptPath = normalizeRelativePosixPath(scriptPath);
const scriptText = fs.readFileSync(path.join(root, ...relativeScriptPath.split('/')), 'utf8');
return {
command: 'bash',
args: ['-n', normalizeRelativePosixPath(scriptPath)],
args: ['-n'],
options: {
cwd: root,
input: scriptText.replace(/\r\n?/g, '\n'),
encoding: 'utf8',
windowsHide: true
}