Skip to content

feat: add support for stdin JSON input - #135

Merged
aduh95 merged 6 commits into
mainfrom
json-stdin
Jan 20, 2026
Merged

feat: add support for stdin JSON input#135
aduh95 merged 6 commits into
mainfrom
json-stdin

Conversation

@aduh95

Copy link
Copy Markdown
Contributor

The goal is to remove the need to clone the repo in https://github.com/nodejs/node/blob/main/.github/workflows/notify-on-push.yml, and instead rely on push.commits like so:

- name: Validate commitsrun: echo "$COMMITS" | npx -q core-validate-commit -env:
COMMITS: ${{ toJSON(github.event.commits) }}

@JakobJingleheimerJakobJingleheimer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for handling this :)

Comment threadbin/cmd.js Outdated
Comment threadbin/cmd.js Outdated
Comment threadtest/cli-test.js
Comment threadtest/cli-test.js
Comment on lines +310 to +312
ls.on('close', (code) => {
tt.equal(code, 1, 'CLI exits with non-zero code on error')
tt.match(errorData, /Input must be an array/, 'error message is shown')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems likely to create bad DX. If it's not an array, just wrap it in an array.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's a use-case for passing a non-array, we can consider it. Until then, it's probably more helpful to throw an error.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant I think it's a likely mistake a user could make, and throwing will just especially frustrate the user "god dammit" because they'll likely know how easy it was to just handle it.

aduh95and others added 2 commits January 20, 2026 22:06
Co-authored-by: Jacob Smith <3012099+JakobJingleheimer@users.noreply.github.com>
@aduh95
aduh95 merged commit 3200730 into mainJan 20, 2026
5 checks passed
@aduh95
aduh95 deleted the json-stdin branch January 20, 2026 21:20
@github-actionsgithub-actionsBot mentioned this pull request Mar 13, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@aduh95@JakobJingleheimer