-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add commit sha to database upload #1922
Conversation
src/database-upload.ts
Outdated
@@ -44,6 +44,9 @@ export async function uploadDatabases( | |||
const bundledDb = await bundleDb(config, language, codeql, language); | |||
const bundledDbSize = fs.statSync(bundledDb).size; | |||
const bundledDbReadStream = fs.createReadStream(bundledDb); | |||
const commitOid = actionsUtil.getCommitOid( | |||
actionsUtil.getRequiredInput("checkout_path"), | |||
); | |||
try { | |||
await client.request( | |||
`POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name`, | |
`POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, |
Oops, I missed we'll need to include commit_oid
here so that it knows how to include it when making the HTTP request. The body of the request is just the database contents, so the commit oid needs to be included as a URL param.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol makes sense 🤦♀️
1677e55
to
aed2e7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
3d409d1
to
7273335
Compare
7273335
to
e62d946
Compare
Code LGTM, but this shouldn't be merged until we've merged the API change and then tested this PR. |
Merge / deployment checklist
This PR adds the commit_oid to the database upload, so that users know - when using the database later - which version of the code it is based on.