Add commit sha to database upload
This commit is contained in:
parent
3dd4ad872b
commit
1727de39fe
3 changed files with 8 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import * as fs from "fs";
|
||||
|
||||
import * as actionsUtil from "./actions-util";
|
||||
import { getOptionalInput } from "./actions-util";
|
||||
import { getApiClient, GitHubApiDetails } from "./api-client";
|
||||
import { getCodeQL } from "./codeql";
|
||||
import { Config } from "./config-utils";
|
||||
|
|
@ -44,6 +45,8 @@ 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 =
|
||||
getOptionalInput("sha") || process.env["GITHUB_SHA"] || "";
|
||||
try {
|
||||
await client.request(
|
||||
`POST https://uploads.github.com/repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name`,
|
||||
|
|
@ -52,6 +55,7 @@ export async function uploadDatabases(
|
|||
repo: repositoryNwo.repo,
|
||||
language,
|
||||
name: `${language}-database`,
|
||||
commit_oid: commitOid,
|
||||
data: bundledDbReadStream,
|
||||
headers: {
|
||||
authorization: `token ${apiDetails.auth}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue