Skip to content

Commit 9db9c82

Browse files
authored
Ci reporting (#5)
* organized test cases for clear reporting. * corrected final-result to test for skipped steps * added missing checkout step * corrected final result logic * reverted to testing * added outcome step * switched to test outcomes * Debugging test case logic * adjusted test outcome logic * corrected invalid Bash script * removed debugging; Adjust output to be more readable * change test summary icon; write negative test outcome to GITHUB_STEP_SUMMARY * debugging failure of positive test * Added more grainular results * corrected ouputs assignments * corrected ouputs assignments use * added exit fail * added body type validation check * fixed linting errors * adjust exception handling for new exception; added clear messages * removed redundant message; incremented version * reverted debugging; added dependabot * moved ext_script.js to temp folder to avoid collision with user code * incremented version --------- Co-authored-by: Daniel I. Kelley <[email protected]>
1 parent 25d6f9b commit 9db9c82

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

action.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff 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
@@ -96,8 +99,10 @@ runs:
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...');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aguilita1/github-script-post-comment",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "GitHub Action to run custom JavaScript and post results to GitHub summary and Pull Request",
55
"author": "Daniel I. Kelley",
66
"license": "MIT",

0 commit comments

Comments
 (0)