Skip to content

Commit 4765368

Browse files
committed
Added extra error handling message
1 parent a48ef4f commit 4765368

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,15 @@ runs:
140140
}
141141
} catch (error) {
142142
console.error(`❌ Error processing ${{ inputs.label }} results:`, error);
143+
144+
// Detect when user forgot to return a value (causing body = undefined)
145+
if ( error.code === 'ERR_INVALID_ARG_TYPE' && /The "data" argument must be of type string/i.test(error.message)) {
146+
console.error(
147+
`💡 Hint: Your script did not return a string. ` +
148+
`Make sure to end your script with a 'return' statement that produces a string, ` +
149+
`for example:\n\n return "✅ My script completed successfully.";`
150+
);
151+
}
152+
143153
core.setOutput('result', JSON.stringify({ error: error.message }));
144154
}

0 commit comments

Comments
 (0)