File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -59,12 +59,15 @@ runs:
5959 - name : Write script to file
6060 shell : bash
6161 run : |
62+ # Ensure the temp directory exists (usually does, but just in case)
63+ mkdir -p "${RUNNER_TEMP}"
64+
6265 # WARNING: Must use single-quoted HEREDOC (<<'EOF') to write the script
6366 # exactly as provided. This preserves characters like $, ${},
6467 # backticks, and multiline formatting without shell or YAML
6568 # interpolation — ensuring the JavaScript is written to the file
6669 # verbatim.
67- cat <<'EOF' > ext_script.js
70+ cat <<'EOF' > "${RUNNER_TEMP}/ ext_script.js"
6871 ${{ inputs.script }}
6972 EOF
7073
9699
97100 console.info("Received Input Label:", "${{ inputs.label }}");
98101 console.info("Received Input post-target:", postTarget);
99- console.info("Reading ext_script.js...");
100- const scriptContent = fs.readFileSync('ext_script.js', 'utf8');
102+ const path = require('path');
103+ const scriptPath = path.join(process.env.RUNNER_TEMP, 'ext_script.js');
104+ console.info(`📄 Reading script from ${scriptPath}`);
105+ const scriptContent = fs.readFileSync(scriptPath, 'utf8');
101106
102107 // Dynamically execute the input script provided in GitHub Action
103108 console.info('🚀 Executing user script...');
You can’t perform that action at this time.
0 commit comments