mirror of
https://github.com/github/codeql-action.git
synced 2026-01-06 22:50:17 +08:00
Compare commits
2 Commits
codeql-bun
...
daverlo/ru
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58974e9e35 | ||
|
|
d8a3eafc18 |
5
lib/upload-lib.js
generated
5
lib/upload-lib.js
generated
@@ -47,6 +47,7 @@ exports.combineSarifFiles = combineSarifFiles;
|
|||||||
// Populates the run.automationDetails.id field using the analysis_key and environment
|
// Populates the run.automationDetails.id field using the analysis_key and environment
|
||||||
// and return an updated sarif file contents.
|
// and return an updated sarif file contents.
|
||||||
function populateRunAutomationDetails(sarifContents, analysis_key, environment) {
|
function populateRunAutomationDetails(sarifContents, analysis_key, environment) {
|
||||||
|
console.log("populateRunAutomationDetails");
|
||||||
if (analysis_key === undefined) {
|
if (analysis_key === undefined) {
|
||||||
return sarifContents;
|
return sarifContents;
|
||||||
}
|
}
|
||||||
@@ -58,6 +59,8 @@ function populateRunAutomationDetails(sarifContents, analysis_key, environment)
|
|||||||
automationID += `${entry[0]}:${entry[1]}/`;
|
automationID += `${entry[0]}:${entry[1]}/`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.log("automationID");
|
||||||
|
console.log(automationID);
|
||||||
const sarif = JSON.parse(sarifContents);
|
const sarif = JSON.parse(sarifContents);
|
||||||
for (const run of sarif.runs || []) {
|
for (const run of sarif.runs || []) {
|
||||||
if (run.automationDetails === undefined) {
|
if (run.automationDetails === undefined) {
|
||||||
@@ -238,9 +241,11 @@ async function uploadFiles(sarifFiles, repositoryNwo, commitOid, ref, analysisKe
|
|||||||
for (const file of sarifFiles) {
|
for (const file of sarifFiles) {
|
||||||
validateSarifFileSchema(file, logger);
|
validateSarifFileSchema(file, logger);
|
||||||
}
|
}
|
||||||
|
console.log("upload files");
|
||||||
let sarifPayload = combineSarifFiles(sarifFiles);
|
let sarifPayload = combineSarifFiles(sarifFiles);
|
||||||
sarifPayload = fingerprints.addFingerprints(sarifPayload, checkoutPath, logger);
|
sarifPayload = fingerprints.addFingerprints(sarifPayload, checkoutPath, logger);
|
||||||
sarifPayload = populateRunAutomationDetails(sarifPayload, analysisKey, environment);
|
sarifPayload = populateRunAutomationDetails(sarifPayload, analysisKey, environment);
|
||||||
|
console.log(sarifPayload);
|
||||||
const zippedSarif = zlib_1.default.gzipSync(sarifPayload).toString("base64");
|
const zippedSarif = zlib_1.default.gzipSync(sarifPayload).toString("base64");
|
||||||
const checkoutURI = file_url_1.default(checkoutPath);
|
const checkoutURI = file_url_1.default(checkoutPath);
|
||||||
const toolNames = util.getToolNames(sarifPayload);
|
const toolNames = util.getToolNames(sarifPayload);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -47,6 +47,7 @@ export function populateRunAutomationDetails(
|
|||||||
analysis_key: string | undefined,
|
analysis_key: string | undefined,
|
||||||
environment: string | undefined
|
environment: string | undefined
|
||||||
): string {
|
): string {
|
||||||
|
console.log("populateRunAutomationDetails");
|
||||||
if (analysis_key === undefined) {
|
if (analysis_key === undefined) {
|
||||||
return sarifContents;
|
return sarifContents;
|
||||||
}
|
}
|
||||||
@@ -60,6 +61,9 @@ export function populateRunAutomationDetails(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("automationID");
|
||||||
|
console.log(automationID);
|
||||||
|
|
||||||
const sarif = JSON.parse(sarifContents);
|
const sarif = JSON.parse(sarifContents);
|
||||||
for (const run of sarif.runs || []) {
|
for (const run of sarif.runs || []) {
|
||||||
if (run.automationDetails === undefined) {
|
if (run.automationDetails === undefined) {
|
||||||
@@ -347,6 +351,7 @@ async function uploadFiles(
|
|||||||
validateSarifFileSchema(file, logger);
|
validateSarifFileSchema(file, logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("upload files");
|
||||||
let sarifPayload = combineSarifFiles(sarifFiles);
|
let sarifPayload = combineSarifFiles(sarifFiles);
|
||||||
sarifPayload = fingerprints.addFingerprints(
|
sarifPayload = fingerprints.addFingerprints(
|
||||||
sarifPayload,
|
sarifPayload,
|
||||||
@@ -359,6 +364,8 @@ async function uploadFiles(
|
|||||||
environment
|
environment
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log(sarifPayload);
|
||||||
|
|
||||||
const zippedSarif = zlib.gzipSync(sarifPayload).toString("base64");
|
const zippedSarif = zlib.gzipSync(sarifPayload).toString("base64");
|
||||||
const checkoutURI = fileUrl(checkoutPath);
|
const checkoutURI = fileUrl(checkoutPath);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user