mirror of
https://github.com/github/codeql-action.git
synced 2026-05-08 23:00:26 +00:00
wip update
This commit is contained in:
Generated
+5
@@ -48,6 +48,7 @@ const status_report_1 = require("./status-report");
|
||||
const trap_caching_1 = require("./trap-caching");
|
||||
const uploadLib = __importStar(require("./upload-lib"));
|
||||
const util = __importStar(require("./util"));
|
||||
const util_1 = require("./util");
|
||||
async function sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger) {
|
||||
const status = (0, status_report_1.getActionsStatus)(error, stats?.analyze_failure_language);
|
||||
const statusReportBase = await (0, status_report_1.createStatusReportBase)(status_report_1.ActionName.Analyze, status, startedAt, config, await util.checkDiskUsage(), logger, error?.message, error?.stack);
|
||||
@@ -177,6 +178,10 @@ async function run() {
|
||||
core.setOutput("db-locations", dbLocations);
|
||||
core.setOutput("sarif-output", path_1.default.resolve(outputDir));
|
||||
const uploadInput = actionsUtil.getOptionalInput("upload");
|
||||
// check if env var GITHUB_ACTION is set to any value
|
||||
if (process.env.GITHUB_ACTION) {
|
||||
throw new util_1.ConfigurationError("deliberately exit early");
|
||||
}
|
||||
if (runStats && actionsUtil.getUploadValue(uploadInput) === "always") {
|
||||
uploadResult = await uploadLib.uploadFromActions(outputDir, actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger);
|
||||
core.setOutput("sarif-id", uploadResult.sarifID);
|
||||
|
||||
File diff suppressed because one or more lines are too long
Generated
+20
-3
@@ -375,9 +375,26 @@ exports.waitForProcessing = waitForProcessing;
|
||||
* Returns whether the provided processing errors are a configuration error.
|
||||
*/
|
||||
function shouldConsiderConfigurationError(processingErrors) {
|
||||
return (processingErrors.length === 1 &&
|
||||
processingErrors[0] ===
|
||||
"CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled");
|
||||
// TODO add a new case here handling...
|
||||
// Advanced setup is not enabled for this repository
|
||||
if (processingErrors.length !== 1) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
// if (
|
||||
// processingErrors[0] ===
|
||||
// "CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled"
|
||||
// ) {
|
||||
// return true;
|
||||
// }
|
||||
// if (
|
||||
// processingErrors[0].includes(
|
||||
// "Advanced setup is not enabled for this repository",
|
||||
// )
|
||||
// ) {
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
}
|
||||
/**
|
||||
* Returns whether the provided processing errors are the result of an invalid SARIF upload request.
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -36,6 +36,7 @@ import { getTotalCacheSize, uploadTrapCaches } from "./trap-caching";
|
||||
import * as uploadLib from "./upload-lib";
|
||||
import { UploadResult } from "./upload-lib";
|
||||
import * as util from "./util";
|
||||
import { ConfigurationError } from "./util";
|
||||
|
||||
interface AnalysisStatusReport
|
||||
extends uploadLib.UploadStatusReport,
|
||||
@@ -281,6 +282,12 @@ async function run() {
|
||||
core.setOutput("db-locations", dbLocations);
|
||||
core.setOutput("sarif-output", path.resolve(outputDir));
|
||||
const uploadInput = actionsUtil.getOptionalInput("upload");
|
||||
|
||||
// check if env var GITHUB_ACTION is set to any value
|
||||
if (process.env.GITHUB_ACTION) {
|
||||
throw new ConfigurationError("deliberately exit early");
|
||||
}
|
||||
|
||||
if (runStats && actionsUtil.getUploadValue(uploadInput) === "always") {
|
||||
uploadResult = await uploadLib.uploadFromActions(
|
||||
outputDir,
|
||||
|
||||
+20
-5
@@ -519,11 +519,26 @@ export async function waitForProcessing(
|
||||
* Returns whether the provided processing errors are a configuration error.
|
||||
*/
|
||||
function shouldConsiderConfigurationError(processingErrors: string[]): boolean {
|
||||
return (
|
||||
processingErrors.length === 1 &&
|
||||
processingErrors[0] ===
|
||||
"CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled"
|
||||
);
|
||||
// TODO add a new case here handling...
|
||||
// Advanced setup is not enabled for this repository
|
||||
if (processingErrors.length !== 1) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
// if (
|
||||
// processingErrors[0] ===
|
||||
// "CodeQL analyses from advanced configurations cannot be processed when the default setup is enabled"
|
||||
// ) {
|
||||
// return true;
|
||||
// }
|
||||
// if (
|
||||
// processingErrors[0].includes(
|
||||
// "Advanced setup is not enabled for this repository",
|
||||
// )
|
||||
// ) {
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user