[upload-sarif@v3] action completely ignore the `sha` input and using commit hash from `checkout_path` instead
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- github-actions, typescript
Research direction
Start in src/upload-sarif-action.ts at line 91 and src/upload-lib.ts at line 605, then trace how the sha input and checkout_path commit are selected. Reproduce the reported upload using the YAML example and inspect the request body. Done means the upload request uses the supplied sha as commit_oid.
Written by the indexing model from the issue text.
Description
- Usage:
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/fix-paths-cpp.sarif
ref: refs/heads/main
sha: a8e616ed369f7f74173a13c5489dbae89c3b12
checkout_path: /runner/_work/parent-repo/build
- Output from action:
request: {
method: 'PUT',
url: 'https://github.com/api/v3/repos/PFO/OpenSIL/code-scanning/analysis',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'CodeQL-Action/3.22.12 octokit-core.js/3.6.0 Node.js/20.18.0 (linux; x64)',
authorization: 'token [REDACTED]',
'content-type': 'application/json; charset=utf-8'
},
body: '{"commit_oid":"b0b0efb3f489d6c16d35gsfd4b388173h99e1049","ref":"refs/heads/main","analysis_key":".github/workflows/codeql-nightly.yml:codeql","analysis_name":"CodeQL- Nightly","sarif":"..."}'
From the output, we can see that it is not actually uploading with the commit_oid that we assigned in the sha input.
Looking at the src code of the upload-sarif action:
- https://github.com/github/codeql-action/blob/main/src/upload-sarif-action.ts#L91
- https://github.com/github/codeql-action/blob/main/src/upload-lib.ts#L605
It is actually using the commit hash sha from the repo under thecheckout_path, which completely ignores theshainput in the action.
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 493
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 44
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/codeql-action
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/codeql-action#4052 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
github/codeql-action#4078 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
github/codeql-action#4008 · 9 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
github/codeql-action#3978 · 4 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
github/codeql-action#3915 · 6 comments · 3 reactions ·
All issues in github/codeql-action
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dennys-bd/agent-hive#184 ·
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
ai-observability bug team/ai-observability
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vicharanashala/fln#563 ·