Repository navigation
feat: onboarding commit-comment action - #1
Raj-StepSecurity wants to merge 2 commits into
Conversation
more changes more changes
fd6e9a8 to
02ca0b9
Compare
|
|
||
| permissions: | ||
| pull-requests: write | ||
| contents: write |
There was a problem hiding this comment.
contents write is required to pass this workflow as it comments on commit.
if dont want contents: write, need to remove test: step
PR ReviewAction TypeNode-based action (runs on node24, entry point dist/index.js). Passed Checks
Failed Checks
Warnings
Security Findings
SummaryThe action is well-structured and passes most onboarding checks. Two code-correctness bugs must be fixed before merging: the missing await on the core action call (which silently swallows all failures) and the unreachable error guard in getReactionsSet. |
| } | ||
| } | ||
|
|
||
| createOrUpdateCommitComment(inputs, body) |
There was a problem hiding this comment.
Bug: missing await
createOrUpdateCommitComment is an async function that returns Promise<void>, but it is called here without await. Any error it throws will produce an unhandled promise rejection that escapes the surrounding try/catch, causing the action to exit with code 0 (success) even when the core operation failed.
| createOrUpdateCommitComment(inputs, body) | |
| await createOrUpdateCommitComment(inputs, body) |
| }) | ||
| ) | ||
| ] | ||
| if (!reactionsSet) { |
There was a problem hiding this comment.
Bug: dead code — this condition is always false
reactionsSet is typed as string[]. An empty array [] is truthy in JavaScript, so if (!reactionsSet) can never be true. The error "No valid reactions are contained" is unreachable, and callers silently receive an empty array when every supplied reaction is invalid.
Fix by checking the length instead:
| if (!reactionsSet) { | |
| if (!reactionsSet.length) { |
No description provided.