mirror of
https://github.com/github/codeql-action.git
synced 2026-11-05 04:29:40 +00:00
Use github.context.payload... to determine if running on fork
This commit is contained in:
3
lib/init-action-post-helper.js
generated
3
lib/init-action-post-helper.js
generated
@@ -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");
|
||||
@@ -117,7 +118,7 @@ async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, p
|
||||
// We do not delete uploaded SARIFs if we're on a fork, as we're missing the
|
||||
// appropriate permissions.
|
||||
if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true" &&
|
||||
repositoryNwo.owner !== "github") {
|
||||
github.context.payload.pull_request?.head.repo.fork === false) {
|
||||
await removeUploadedSarif(uploadFailedSarifResult, logger);
|
||||
}
|
||||
// Upload appropriate Actions artifacts for debugging
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -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";
|
||||
@@ -186,7 +188,7 @@ export async function run(
|
||||
// appropriate permissions.
|
||||
if (
|
||||
process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true" &&
|
||||
repositoryNwo.owner !== "github"
|
||||
github.context.payload.pull_request?.head.repo.fork === false
|
||||
) {
|
||||
await removeUploadedSarif(uploadFailedSarifResult, logger);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user