Skip to content

Commit

Permalink
Showing 3 changed files with 7 additions and 7 deletions.
5 changes: 3 additions & 2 deletions lib/database-upload.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/database-upload.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/database-upload.ts
@@ -40,9 +40,7 @@ export async function uploadDatabases(
// Although we are uploading arbitrary file contents to the API, it's worth
// noting that it's the API's job to validate that the contents is acceptable.
// This API method is available to anyone with write access to the repo.
const payload = fs.readFileSync(
await bundleDb(config, language, codeql, language)
);
const bundledDb = await bundleDb(config, language, codeql, language);
try {
await client.request(
`POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name`,
@@ -51,10 +49,11 @@ export async function uploadDatabases(
repo: repositoryNwo.repo,
language,
name: `${language}-database`,
data: payload,
data: fs.createReadStream(bundledDb),
headers: {
authorization: `token ${apiDetails.auth}`,
"Content-Type": "application/zip",
"Content-Length": fs.statSync(bundledDb).size,
},
}
);

0 comments on commit 6ce923c

Please sign in to comment.