codeql-action/upload-sarif@v1 doesn't accept empty sarif
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- github-actions, typescript
调研方向
使用空的 SARIF 示例重现该失败,然后从报告的上传路径所在的 lib/upload-lib.js 开始,并跟踪其在 lib/upload-sarif-action.js 中的调用方。确认空的 runs 数组可以完成而不会出现所示的 422 错误,并在测试上传行为的任何位置添加或更新覆盖率。
由索引模型根据 Issue 内容生成。
描述
Expected behaviour:
No error
Actual behaviour:
codeql-action/upload-sarif@v1 doesn't accept empty sarif
Exemple:
{
"$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0-rtm.5.json",
"version": "2.1.0",
"runs": []
}
Result:
Uploading sarif files: ["final.sarif"]
Uploading results
Error: Invalid request.
1 item required; only 0 were supplied.
RequestError [HttpError]: Invalid request.
1 item required; only 0 were supplied.
at /home/runner/work/_actions/github/codeql-action/v1/node_modules/@octokit/request/dist-node/index.js:66:23
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async uploadPayload (/home/runner/work/_actions/github/codeql-action/v1/lib/upload-lib.js:60:22)
at async uploadFiles (/home/runner/work/_actions/github/codeql-action/v1/lib/upload-lib.js:217:5)
at async Object.uploadFromActions (/home/runner/work/_actions/github/codeql-action/v1/lib/upload-lib.js:91:12)
at async run (/home/runner/work/_actions/github/codeql-action/v1/lib/upload-sarif-action.js:34:29)
at async runWrapper (/home/runner/work/_actions/github/codeql-action/v1/lib/upload-sarif-action.js:46:9) {
name: 'HttpError',
status: 422,
headers: {
'access-control-allow-origin': '*',
'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
connection: 'close',
'content-length': '123',
'content-security-policy': "default-src 'none'",
'content-type': 'application/json; charset=utf-8',
date: 'Fri, 12 Feb 2021 20:35:44 GMT',
'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
server: 'GitHub.com',
'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
vary: 'Accept-Encoding, Accept, X-Requested-With',
'x-content-type-options': 'nosniff',
'x-frame-options': 'deny',
'x-github-media-type': 'github.v3; format=json',
'x-github-request-id': '07C1:040D:2E46AC:90C8F9:6026E6A0',
'x-ratelimit-limit': '500',
'x-ratelimit-remaining': '496',
'x-ratelimit-reset': '1613162249',
'x-ratelimit-used': '4',
'x-xss-protection': '1; mode=block'
},
request: {
method: 'PUT',
url: 'https://api.github.com/repos/rizinorg/rizin/code-scanning/analysis',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'CodeQL Action octokit-core.js/3.1.2 Node.js/12.13.1 (linux; x64)',
authorization: 'token [REDACTED]',
'content-type': 'application/json; charset=utf-8'
},
body: '{"commit_oid":"820c45f5933c343c34a94e1d2382e91980359a8f","ref":"refs/pull/610/merge","analysis_key":".github/workflows/code-analysis.yml:build","analysis_name":"Code scanning","sarif":"H4sIAAAAAAAAA6tWKkstKs7Mz1OyUjLSM9QzUNJRKirNK1ayio6tBQBSlZKzHQAAAA==","workflow_run_id":562142767,"checkout_uri":"file:///home/runner/work/rizin/rizin","environment":"{\\n \\"name\\": \\"CodeQL-javascript\\"\\n}","started_at":"2021-02-12T20:31:48.765Z","tool_names":[],"base_ref":"refs/heads/dev","base_sha":"af5ebbb92533d1015336f2257bfe5e7dc67c2494"}',
request: { agent: [Agent], hook: [Function: bound bound register] }
},
documentation_url: 'https://docs.github.com/rest'
}
The sarif file was generated by github/codeql-action/analyze@v1 and sarif-multitool.
npx @microsoft/sarif-multitool merge reports/*.sarif
- 主要语言
- TypeScript
- 星标
- 1.6k
- 派生
- 493
- 平均合并
- 1 天 13 小时
- 30 天内合并 PR
- 44
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/codeql-action 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
github/codeql-action#4052 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 45/100
github/codeql-action#4078 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 48/100
github/codeql-action#4008 · 9 条评论 ·
-
难度 4/5 3-5 天 新手友好度 52/100
github/codeql-action#3978 · 4 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 48/100
github/codeql-action#3915 · 6 条评论 · 3 个 reaction ·
查看 github/codeql-action 的全部 Issue
相似的 Issue
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
supermomonga/zcode-acp#24 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
growthbook/growthbook#7100 ·
-
triage
难度 1/5 1-3 小时 新手友好度 88/100