From f65ecd09c7594dc5bfccb15a694c4d15971c9b73 Mon Sep 17 00:00:00 2001 From: Angela P Wen Date: Tue, 16 Jan 2024 16:07:58 -0800 Subject: [PATCH] Only delete SARIF in PR check if not running on a fork (#2084) --- lib/analyze-action.js | 7 +++---- lib/analyze-action.js.map | 2 +- lib/init-action-post-helper.js | 9 ++++++++- lib/init-action-post-helper.js.map | 2 +- src/analyze-action.ts | 7 +++---- src/init-action-post-helper.ts | 11 ++++++++++- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/lib/analyze-action.js b/lib/analyze-action.js index f5bb3787e9..1078ee1a6d 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -50,7 +50,6 @@ 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)("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"); } catch (unwrappedError) { - const error = (0, util_1.wrapError)(unwrappedError); + const error = util.wrapError(unwrappedError); if (actionsUtil.getOptionalInput("expect-error") !== "true" || hasBadExpectErrorInput()) { core.setFailed(error.message); @@ -261,9 +260,9 @@ async function runWrapper() { await exports.runPromise; } 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(); //# sourceMappingURL=analyze-action.js.map \ No newline at end of file diff --git a/lib/analyze-action.js.map b/lib/analyze-action.js.map index fa2857a4f2..c4001913ab 100644 --- a/lib/analyze-action.js.map +++ b/lib/analyze-action.js.map @@ -1 +1 @@ -{"version":3,"file":"analyze-action.js","sourceRoot":"","sources":["../src/analyze-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,2CAAyC;AAEzC,oDAAsC;AACtC,uDAAmD;AAEnD,4DAA8C;AAC9C,uCAOmB;AACnB,6CAA+D;AAC/D,2CAA2C;AAC3C,qCAAqC;AACrC,iDAAmD;AACnD,uDAAoD;AACpD,+CAA8D;AAC9D,+CAAuC;AACvC,mDAA2C;AAC3C,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,8DAAgD;AAChD,mDAKyB;AACzB,iDAAqE;AACrE,wDAA0C;AAE1C,6CAA+B;AAC/B,iCAAoD;AAkBpD,KAAK,UAAU,gBAAgB,CAC7B,SAAe,EACf,MAA0B,EAC1B,KAAuC,EACvC,KAAwB,EACxB,mBAAuC,EACvC,iBAAsD,EACtD,mBAA4B,EAC5B,MAAc;IAEd,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAAC;IACxE,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,QAAQ,EACR,MAAM,EACN,SAAS,EACT,MAAM,IAAI,CAAC,cAAc,EAAE,EAC3B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,KAAK,CACb,CAAC;IACF,MAAM,MAAM,GAAuB;QACjC,GAAG,gBAAgB;QACnB,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;QAChB,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAC;KAC7B,CAAC;IACF,IAAI,MAAM,IAAI,mBAAmB,EAAE,CAAC;QAClC,MAAM,2BAA2B,GAAqC;YACpE,GAAG,MAAM;YACT,6BAA6B,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,CAAC,CAAC;YACnE,4BAA4B,EAAE,IAAI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AED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"analyze-action.js","sourceRoot":"","sources":["../src/analyze-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,2CAAyC;AAEzC,oDAAsC;AACtC,uDAAmD;AAEnD,4DAA8C;AAC9C,uCAOmB;AACnB,6CAA+D;AAC/D,2CAA2C;AAC3C,qCAAqC;AACrC,iDAAmD;AACnD,uDAAoD;AACpD,+CAA8D;AAC9D,+CAAuC;AACvC,mDAA2C;AAC3C,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,8DAAgD;AAChD,mDAKyB;AACzB,iDAAqE;AACrE,wDAA0C;AAE1C,6CAA+B;AAkB/B,KAAK,UAAU,gBAAgB,CAC7B,SAAe,EACf,MAA0B,EAC1B,KAAuC,EACvC,KAAwB,EACxB,mBAAuC,EACvC,iBAAsD,EACtD,mBAA4B,EAC5B,MAAc;IAEd,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAAC;IACxE,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,QAAQ,EACR,MAAM,EACN,SAAS,EACT,MAAM,IAAI,CAAC,cAAc,EAAE,EAC3B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,KAAK,CACb,CAAC;IACF,MAAM,MAAM,GAAuB;QACjC,GAAG,gBAAgB;QACnB,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;QAChB,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAC;KAC7B,CAAC;IACF,IAAI,MAAM,IAAI,mBAAmB,EAAE,CAAC;QAClC,MAAM,2BAA2B,GAAqC;YACpE,GAAG,MAAM;YACT,6BAA6B,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB,IAAI,CAAC,CAAC;YACnE,4BAA4B,EAAE,IAAI,CAAC,KAAK,CACtC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ED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/init-action-post-helper.js b/lib/init-action-post-helper.js index 0af2975210..379263bc2a 100644 --- a/lib/init-action-post-helper.js +++ b/lib/init-action-post-helper.js @@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.run = exports.tryUploadSarifIfRunFailed = void 0; +const github = __importStar(require("@actions/github")); const actionsUtil = __importStar(require("./actions-util")); const api_client_1 = require("./api-client"); const codeql_1 = require("./codeql"); @@ -115,7 +116,13 @@ async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, p `but the result was instead ${error}.`); } if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") { - await removeUploadedSarif(uploadFailedSarifResult, logger); + if (!github.context.payload.pull_request?.head.repo.fork) { + 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 if (config.debugMode) { diff --git a/lib/init-action-post-helper.js.map b/lib/init-action-post-helper.js.map index 7079e87077..9ab3d9751f 100644 --- a/lib/init-action-post-helper.js.map +++ b/lib/init-action-post-helper.js.map @@ -1 +1 @@ -{"version":3,"file":"init-action-post-helper.js","sourceRoot":"","sources":["../src/init-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA8C;AAC9C,6CAA4C;AAC5C,qCAAqC;AACrC,iDAAmD;AACnD,+CAAuC;AACvC,mDAA6D;AAE7D,6CAAiE;AACjE,wDAA0C;AAC1C,iCAOgB;AAChB,yCAKoB;AAcpB,SAAS,mCAAmC,CAC1C,KAAc;IAEd,MAAM,YAAY,GAAG,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC;IACtC,OAAO;QACL,uBAAuB,EAAE,YAAY,CAAC,OAAO;QAC7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xB,WAAW,EAAE,QAAQ,CAAC,EAAE;qBACzB,CACF,CAAC;oBACF,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;gBACnC,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,MAAM,WAAW,GAAG,IAAA,sBAAe,EAAC,CAAC,CAAC,CAAC;oBACvC,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CACrC,mCAAmC,CACpC;wBACC,CAAC,CAAC,YAAY,QAAQ,CAAC,EAAE,iDAAiD;wBAC1E,CAAC,CAAC,WAAW,CAAC;oBAChB,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;gBAC9B,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,uDAAuD,OAAO,WAAW,YAAY,CAAC,IAAI,CAAC,MAAM,GAAG,CACrG,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CACb,qDAAqD,IAAA,sBAAe,EAClE,CAAC,CACF,EAAE,CACJ,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,OAAO,CACZ,2HAA2H,CAC5H,CAAC;IACJ,CAAC;AACH,CAAC"} \ No newline at end of file +{"version":3,"file":"init-action-post-helper.js","sourceRoot":"","sources":["../src/init-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA0C;AAE1C,4DAA8C;AAC9C,6CAA4C;AAC5C,qCAAqC;AACrC,iDAAmD;AACnD,+CAAuC;AACvC,mDAA6D;AAE7D,6CAAiE;AACjE,wDAA0C;AAC1C,iCAOgB;AAChB,yCAKoB;AAcpB,SAAS,mCAAmC,CAC1C,KAAc;IAEd,MAAM,YAAY,GAAG,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC;IACt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,IAAI,CAAC,CAAC,CAAC,CAAC;gBACtC,MAAM,CAAC,IAAI,CAAC,0BAA0B,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;gBACtD,IAAI,CAAC;oBACH,MAAM,MAAM,CAAC,OAAO,CAClB,+EAA+E,EAC/E;wBACE,KAAK,EAAE,aAAa,CAAC,KAAK;wBAC1B,IAAI,EAAE,aAAa,CAAC,IAAI;wBACxB,WAAW,EAAE,QAAQ,CAAC,EAAE;qBACzB,CACF,CAAC;oBACF,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;gBACnC,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,MAAM,WAAW,GAAG,IAAA,sBAAe,EAAC,CAAC,CAAC,CAAC;oBACvC,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CACrC,mCAAmC,CACpC;wBACC,CAAC,CAAC,YAAY,QAAQ,CAAC,EAAE,iDAAiD;wBAC1E,CAAC,CAAC,WAAW,CAAC;oBAChB,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;gBAC9B,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,uDAAuD,OAAO,WAAW,YAAY,CAAC,IAAI,CAAC,MAAM,GAAG,CACrG,CAAC;YACJ,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CACb,qDAAqD,IAAA,sBAAe,EAClE,CAAC,CACF,EAAE,CACJ,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,OAAO,CACZ,2HAA2H,CAC5H,CAAC;IACJ,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/src/analyze-action.ts b/src/analyze-action.ts index 692453d3ad..809697ee8b 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -36,7 +36,6 @@ import { getTotalCacheSize, uploadTrapCaches } from "./trap-caching"; import * as uploadLib from "./upload-lib"; import { UploadResult } from "./upload-lib"; import * as util from "./util"; -import { checkForTimeout, wrapError } from "./util"; interface AnalysisStatusReport extends uploadLib.UploadStatusReport, @@ -355,7 +354,7 @@ async function run() { } core.exportVariable(EnvVar.ANALYZE_DID_COMPLETE_SUCCESSFULLY, "true"); } catch (unwrappedError) { - const error = wrapError(unwrappedError); + const error = util.wrapError(unwrappedError); if ( actionsUtil.getOptionalInput("expect-error") !== "true" || hasBadExpectErrorInput() @@ -436,9 +435,9 @@ async function runWrapper() { try { await runPromise; } 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(); diff --git a/src/init-action-post-helper.ts b/src/init-action-post-helper.ts index 42793d33e9..c58b095066 100644 --- a/src/init-action-post-helper.ts +++ b/src/init-action-post-helper.ts @@ -1,3 +1,5 @@ +import * as github from "@actions/github"; + import * as actionsUtil from "./actions-util"; import { getApiClient } from "./api-client"; import { getCodeQL } from "./codeql"; @@ -183,7 +185,14 @@ export async function run( } if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") { - await removeUploadedSarif(uploadFailedSarifResult, logger); + if (!github.context.payload.pull_request?.head.repo.fork) { + 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