Description
Describe the feature or problem you’d like to solve
I'm trying to submit a ~200KB SARIF file to the upload SARIF endpoint.
Using gh involves constructing the entire payload as a command-line, and shells don't really approve of 200KB command-lines...
Proposed solution
Add some syntax to allow passing data via a file instead of expanded on a command line will allow users to use gh to submit large SARIF files (and probably other payloads) instead of resorting to curl.
(check-spelling is currently on the fence and uses gh some of the time and curl some of the time.)
Additional context
Trying to use gh fails miserably:
https://github.com/check-spelling-sandbox/terminal/actions/runs/12045375307/job/33583882502#step:2:14473
/home/runner/work/_temp/ed03237b-484a-4109-85ed-e2c9b2bc52a4.sh: line 11: /usr/bin/gh: Argument list too long
curl -s -L
-X POST
-H "Accept: application/vnd.github+json"
-H "Authorization: ***"
-H "X-GitHub-Api-Version: 2022-11-28"
"$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/code-scanning/sarifs"
-d @"$sarif_payload" -o "$result"
Activity
williammartin commentedon Nov 29, 2024
Hey @jsoref,
Is the
--inputflag insufficient for your use case?I'm honestly not sure how it interacts with -
f, but based on your curl I'm also not sure if you need it? Happy to spend time doing further investigation if it is something you need.Cheers.
jsoref commentedon Nov 29, 2024
I couldn't tell. If it works, it needs to be documented in the
-fdocumentation.williammartin commentedon Nov 29, 2024
Actually it looks like it's covered in the Long description:
williammartin commentedon Nov 29, 2024
And in fact, in the
-F/--fieldflag part in the long description it says:Which I had no idea about!
This looks like it satisfies the same feature as curl right?
[-]Provide an equivalent to `curl`'s `-d @filename` for at least `gh api`[/-][+]Improve `gh api` short flag output to mention `@` support[/+]jsoref commentedon Nov 29, 2024
Hmm, it sounds like the feature is indeed there. I'd argue that the
@stuff should be hinted in the summary just as-is for-i: