mirror of
https://github.com/github/codeql-action.git
synced 2025-12-18 05:19:18 +08:00
Compare commits
5 Commits
mbg/csharp
...
stop-delet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
648a31a015 | ||
|
|
b0b38b29b2 | ||
|
|
30f279ce08 | ||
|
|
a6427b3267 | ||
|
|
7a76543b0d |
7
lib/analyze-action.js
generated
7
lib/analyze-action.js
generated
@@ -50,7 +50,6 @@ const status_report_1 = require("./status-report");
|
|||||||
const trap_caching_1 = require("./trap-caching");
|
const trap_caching_1 = require("./trap-caching");
|
||||||
const uploadLib = __importStar(require("./upload-lib"));
|
const uploadLib = __importStar(require("./upload-lib"));
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
const util_1 = require("./util");
|
|
||||||
async function sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger) {
|
async function sendStatusReport(startedAt, config, stats, error, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, logger) {
|
||||||
const status = (0, status_report_1.getActionsStatus)(error, stats?.analyze_failure_language);
|
const status = (0, status_report_1.getActionsStatus)(error, stats?.analyze_failure_language);
|
||||||
const statusReportBase = await (0, status_report_1.createStatusReportBase)("finish", status, startedAt, await util.checkDiskUsage(), error?.message, error?.stack);
|
const statusReportBase = await (0, status_report_1.createStatusReportBase)("finish", status, startedAt, await util.checkDiskUsage(), error?.message, error?.stack);
|
||||||
@@ -228,7 +227,7 @@ async function run() {
|
|||||||
core.exportVariable(environment_1.EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY, "true");
|
core.exportVariable(environment_1.EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY, "true");
|
||||||
}
|
}
|
||||||
catch (unwrappedError) {
|
catch (unwrappedError) {
|
||||||
const error = (0, util_1.wrapError)(unwrappedError);
|
const error = util.wrapError(unwrappedError);
|
||||||
if (actionsUtil.getOptionalInput("expect-error") !== "true" ||
|
if (actionsUtil.getOptionalInput("expect-error") !== "true" ||
|
||||||
hasBadExpectErrorInput()) {
|
hasBadExpectErrorInput()) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
@@ -261,9 +260,9 @@ async function runWrapper() {
|
|||||||
await exports.runPromise;
|
await exports.runPromise;
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.setFailed(`analyze action failed: ${(0, util_1.wrapError)(error).message}`);
|
core.setFailed(`analyze action failed: ${util.wrapError(error).message}`);
|
||||||
}
|
}
|
||||||
await (0, util_1.checkForTimeout)();
|
await util.checkForTimeout();
|
||||||
}
|
}
|
||||||
void runWrapper();
|
void runWrapper();
|
||||||
//# sourceMappingURL=analyze-action.js.map
|
//# sourceMappingURL=analyze-action.js.map
|
||||||
File diff suppressed because one or more lines are too long
7
lib/init-action-post-helper.js
generated
7
lib/init-action-post-helper.js
generated
@@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.run = exports.tryUploadSarifIfRunFailed = void 0;
|
exports.run = exports.tryUploadSarifIfRunFailed = void 0;
|
||||||
|
const github = __importStar(require("@actions/github"));
|
||||||
const actionsUtil = __importStar(require("./actions-util"));
|
const actionsUtil = __importStar(require("./actions-util"));
|
||||||
const api_client_1 = require("./api-client");
|
const api_client_1 = require("./api-client");
|
||||||
const codeql_1 = require("./codeql");
|
const codeql_1 = require("./codeql");
|
||||||
@@ -115,8 +116,14 @@ async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, p
|
|||||||
`but the result was instead ${error}.`);
|
`but the result was instead ${error}.`);
|
||||||
}
|
}
|
||||||
if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") {
|
if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") {
|
||||||
|
if (!github.context.payload.pull_request?.head.repo.fork) {
|
||||||
await removeUploadedSarif(uploadFailedSarifResult, logger);
|
await removeUploadedSarif(uploadFailedSarifResult, logger);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
logger.info("Skipping deletion of failed SARIF because the workflow was triggered from a fork of " +
|
||||||
|
"codeql-action and doesn't have the appropriate permissions for deletion.");
|
||||||
|
}
|
||||||
|
}
|
||||||
// Upload appropriate Actions artifacts for debugging
|
// Upload appropriate Actions artifacts for debugging
|
||||||
if (config.debugMode) {
|
if (config.debugMode) {
|
||||||
logger.info("Debug mode is on. Uploading available database bundles and logs as Actions debugging artifacts...");
|
logger.info("Debug mode is on. Uploading available database bundles and logs as Actions debugging artifacts...");
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -36,7 +36,6 @@ import { getTotalCacheSize, uploadTrapCaches } from "./trap-caching";
|
|||||||
import * as uploadLib from "./upload-lib";
|
import * as uploadLib from "./upload-lib";
|
||||||
import { UploadResult } from "./upload-lib";
|
import { UploadResult } from "./upload-lib";
|
||||||
import * as util from "./util";
|
import * as util from "./util";
|
||||||
import { checkForTimeout, wrapError } from "./util";
|
|
||||||
|
|
||||||
interface AnalysisStatusReport
|
interface AnalysisStatusReport
|
||||||
extends uploadLib.UploadStatusReport,
|
extends uploadLib.UploadStatusReport,
|
||||||
@@ -355,7 +354,7 @@ async function run() {
|
|||||||
}
|
}
|
||||||
core.exportVariable(EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY, "true");
|
core.exportVariable(EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY, "true");
|
||||||
} catch (unwrappedError) {
|
} catch (unwrappedError) {
|
||||||
const error = wrapError(unwrappedError);
|
const error = util.wrapError(unwrappedError);
|
||||||
if (
|
if (
|
||||||
actionsUtil.getOptionalInput("expect-error") !== "true" ||
|
actionsUtil.getOptionalInput("expect-error") !== "true" ||
|
||||||
hasBadExpectErrorInput()
|
hasBadExpectErrorInput()
|
||||||
@@ -436,9 +435,9 @@ async function runWrapper() {
|
|||||||
try {
|
try {
|
||||||
await runPromise;
|
await runPromise;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(`analyze action failed: ${wrapError(error).message}`);
|
core.setFailed(`analyze action failed: ${util.wrapError(error).message}`);
|
||||||
}
|
}
|
||||||
await checkForTimeout();
|
await util.checkForTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void runWrapper();
|
void runWrapper();
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import * as github from "@actions/github";
|
||||||
|
|
||||||
import * as actionsUtil from "./actions-util";
|
import * as actionsUtil from "./actions-util";
|
||||||
import { getApiClient } from "./api-client";
|
import { getApiClient } from "./api-client";
|
||||||
import { getCodeQL } from "./codeql";
|
import { getCodeQL } from "./codeql";
|
||||||
@@ -183,7 +185,14 @@ export async function run(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") {
|
if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") {
|
||||||
|
if (!github.context.payload.pull_request?.head.repo.fork) {
|
||||||
await removeUploadedSarif(uploadFailedSarifResult, logger);
|
await removeUploadedSarif(uploadFailedSarifResult, logger);
|
||||||
|
} else {
|
||||||
|
logger.info(
|
||||||
|
"Skipping deletion of failed SARIF because the workflow was triggered from a fork of " +
|
||||||
|
"codeql-action and doesn't have the appropriate permissions for deletion.",
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upload appropriate Actions artifacts for debugging
|
// Upload appropriate Actions artifacts for debugging
|
||||||
|
|||||||
Reference in New Issue
Block a user