feat: patch start-proxy-action, analyze-action and init-action as well
This commit is contained in:
parent
2a8a5ccf3b
commit
bd02c19352
18 changed files with 57 additions and 13 deletions
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
import * as core from "@actions/core";
|
||||
|
||||
import { getTemporaryDirectory } from "./actions-util";
|
||||
import * as actionsUtil from "./actions-util";
|
||||
import { getGitHubVersion } from "./api-client";
|
||||
import { getConfig } from "./config-utils";
|
||||
import * as debugArtifacts from "./debug-artifacts";
|
||||
|
|
@ -21,6 +21,7 @@ import {
|
|||
|
||||
async function runWrapper() {
|
||||
try {
|
||||
actionsUtil.restoreInputs();
|
||||
const logger = getActionsLogger();
|
||||
const gitHubVersion = await getGitHubVersion();
|
||||
checkGitHubVersionInRange(gitHubVersion, logger);
|
||||
|
|
@ -30,14 +31,17 @@ async function runWrapper() {
|
|||
const features = new Features(
|
||||
gitHubVersion,
|
||||
repositoryNwo,
|
||||
getTemporaryDirectory(),
|
||||
actionsUtil.getTemporaryDirectory(),
|
||||
logger,
|
||||
);
|
||||
|
||||
// Upload SARIF artifacts if we determine that this is a first-party analysis run.
|
||||
// For third-party runs, this artifact will be uploaded in the `upload-sarif-post` step.
|
||||
if (process.env[EnvVar.INIT_ACTION_HAS_RUN] === "true") {
|
||||
const config = await getConfig(getTemporaryDirectory(), logger);
|
||||
const config = await getConfig(
|
||||
actionsUtil.getTemporaryDirectory(),
|
||||
logger,
|
||||
);
|
||||
if (config !== undefined) {
|
||||
await withGroup("Uploading combined SARIF debug artifact", () =>
|
||||
debugArtifacts.uploadCombinedSarifArtifacts(
|
||||
|
|
|
|||
|
|
@ -199,6 +199,10 @@ async function run() {
|
|||
let didUploadTrapCaches = false;
|
||||
util.initializeEnvironment(actionsUtil.getActionVersion());
|
||||
|
||||
// Work around for issue in actions/runner, details at
|
||||
// https://github.com/github/codeql-action/issues/2553
|
||||
actionsUtil.persistInputs();
|
||||
|
||||
const logger = getActionsLogger();
|
||||
try {
|
||||
const statusReportBase = await createStatusReportBase(
|
||||
|
|
|
|||
|
|
@ -6,7 +6,11 @@
|
|||
|
||||
import * as core from "@actions/core";
|
||||
|
||||
import { getTemporaryDirectory, printDebugLogs } from "./actions-util";
|
||||
import {
|
||||
restoreInputs,
|
||||
getTemporaryDirectory,
|
||||
printDebugLogs,
|
||||
} from "./actions-util";
|
||||
import { getGitHubVersion } from "./api-client";
|
||||
import { Config, getConfig } from "./config-utils";
|
||||
import * as debugArtifacts from "./debug-artifacts";
|
||||
|
|
@ -42,6 +46,10 @@ async function runWrapper() {
|
|||
| initActionPostHelper.UploadFailedSarifResult
|
||||
| undefined;
|
||||
try {
|
||||
// Work around for issue in actions/runner, details at
|
||||
// https://github.com/github/codeql-action/issues/2553
|
||||
restoreInputs();
|
||||
|
||||
const gitHubVersion = await getGitHubVersion();
|
||||
checkGitHubVersionInRange(gitHubVersion, logger);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import {
|
|||
getOptionalInput,
|
||||
getRequiredInput,
|
||||
getTemporaryDirectory,
|
||||
persistInputs,
|
||||
} from "./actions-util";
|
||||
import { getGitHubVersion } from "./api-client";
|
||||
import { CodeQL } from "./codeql";
|
||||
|
|
@ -250,6 +251,10 @@ async function run() {
|
|||
const logger = getActionsLogger();
|
||||
initializeEnvironment(getActionVersion());
|
||||
|
||||
// Work around for issue in actions/runner, details at
|
||||
// https://github.com/github/codeql-action/issues/2553
|
||||
persistInputs();
|
||||
|
||||
let config: configUtils.Config | undefined;
|
||||
let codeql: CodeQL;
|
||||
let toolsDownloadStatusReport: ToolsDownloadStatusReport | undefined;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ import {
|
|||
|
||||
async function runWrapper() {
|
||||
try {
|
||||
// Work around for issue in actions/runner, details at
|
||||
// https://github.com/github/codeql-action/issues/2553
|
||||
actionsUtil.restoreInputs();
|
||||
const pid = core.getState("proxy-process-pid");
|
||||
if (pid) {
|
||||
process.kill(Number(pid));
|
||||
|
|
|
|||
|
|
@ -91,6 +91,10 @@ function generateCertificateAuthority(): CertificateAuthority {
|
|||
}
|
||||
|
||||
async function runWrapper() {
|
||||
// Work around for issue in actions/runner, details at
|
||||
// https://github.com/github/codeql-action/issues/2553
|
||||
actionsUtil.persistInputs();
|
||||
|
||||
const logger = getActionsLogger();
|
||||
|
||||
// Setup logging for the proxy
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue