mirror of
https://github.com/github/codeql-action.git
synced 2026-01-05 06:00:32 +08:00
Compare commits
15 Commits
v1.0.2
...
robertbrig
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ebdeafc2f | ||
|
|
f6d1bad81b | ||
|
|
f3cd5fa001 | ||
|
|
33ac512514 | ||
|
|
6a7c2369bf | ||
|
|
9c28349a87 | ||
|
|
b4914d76a2 | ||
|
|
69c30da5ad | ||
|
|
6fc1280a3c | ||
|
|
b985a67b97 | ||
|
|
c989ee7b39 | ||
|
|
366b68eda0 | ||
|
|
d693b3cb0d | ||
|
|
429471162a | ||
|
|
2a9a602a5e |
1
CODEOWNERS
Normal file
1
CODEOWNERS
Normal file
@@ -0,0 +1 @@
|
|||||||
|
**/* @github/codeql-action-reviewers
|
||||||
@@ -34,6 +34,10 @@ inputs:
|
|||||||
category:
|
category:
|
||||||
description: String used by Code Scanning for matching the analyses
|
description: String used by Code Scanning for matching the analyses
|
||||||
required: false
|
required: false
|
||||||
|
upload-database:
|
||||||
|
description: Whether to upload the resulting CodeQL database
|
||||||
|
required: false
|
||||||
|
default: "true"
|
||||||
token:
|
token:
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
30
lib/actions-util.js
generated
30
lib/actions-util.js
generated
@@ -448,10 +448,6 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
|
|||||||
return statusReport;
|
return statusReport;
|
||||||
}
|
}
|
||||||
exports.createStatusReportBase = createStatusReportBase;
|
exports.createStatusReportBase = createStatusReportBase;
|
||||||
function isHTTPError(arg) {
|
|
||||||
var _a;
|
|
||||||
return ((_a = arg) === null || _a === void 0 ? void 0 : _a.status) !== undefined && Number.isInteger(arg.status);
|
|
||||||
}
|
|
||||||
const GENERIC_403_MSG = "The repo on which this action is running is not opted-in to CodeQL code scanning.";
|
const GENERIC_403_MSG = "The repo on which this action is running is not opted-in to CodeQL code scanning.";
|
||||||
const GENERIC_404_MSG = "Not authorized to used the CodeQL code scanning feature on this repo.";
|
const GENERIC_404_MSG = "Not authorized to used the CodeQL code scanning feature on this repo.";
|
||||||
const OUT_OF_DATE_MSG = "CodeQL Action is out-of-date. Please upgrade to the latest version of codeql-action.";
|
const OUT_OF_DATE_MSG = "CodeQL Action is out-of-date. Please upgrade to the latest version of codeql-action.";
|
||||||
@@ -481,7 +477,7 @@ async function sendStatusReport(statusReport) {
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
if (isHTTPError(e)) {
|
if (util_1.isHTTPError(e)) {
|
||||||
switch (e.status) {
|
switch (e.status) {
|
||||||
case 403:
|
case 403:
|
||||||
if (workflowIsTriggeredByPushEvent() && isDependabotActor()) {
|
if (workflowIsTriggeredByPushEvent() && isDependabotActor()) {
|
||||||
@@ -540,4 +536,28 @@ function getRelativeScriptPath() {
|
|||||||
return path.relative(actionsDirectory, __filename);
|
return path.relative(actionsDirectory, __filename);
|
||||||
}
|
}
|
||||||
exports.getRelativeScriptPath = getRelativeScriptPath;
|
exports.getRelativeScriptPath = getRelativeScriptPath;
|
||||||
|
// Reads the contents of GITHUB_EVENT_PATH as a JSON object
|
||||||
|
function getWorkflowEvent() {
|
||||||
|
const eventJsonFile = util_1.getRequiredEnvParam("GITHUB_EVENT_PATH");
|
||||||
|
try {
|
||||||
|
return JSON.parse(fs.readFileSync(eventJsonFile, "utf-8"));
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
throw new Error(`Unable to read workflow event JSON from ${eventJsonFile}: ${e}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Is the version of the repository we are currently analyzing from the default branch,
|
||||||
|
// or alternatively from another branch or a pull request.
|
||||||
|
async function isAnalyzingDefaultBranch() {
|
||||||
|
var _a, _b;
|
||||||
|
// Get the current ref and trim and refs/heads/ prefix
|
||||||
|
let currentRef = await getRef();
|
||||||
|
currentRef = currentRef.startsWith("refs/heads/")
|
||||||
|
? currentRef.substr("refs/heads/".length)
|
||||||
|
: currentRef;
|
||||||
|
const event = getWorkflowEvent();
|
||||||
|
const defaultBranch = (_b = (_a = event) === null || _a === void 0 ? void 0 : _a.repository) === null || _b === void 0 ? void 0 : _b.default_branch;
|
||||||
|
return currentRef === defaultBranch;
|
||||||
|
}
|
||||||
|
exports.isAnalyzingDefaultBranch = isAnalyzingDefaultBranch;
|
||||||
//# sourceMappingURL=actions-util.js.map
|
//# sourceMappingURL=actions-util.js.map
|
||||||
File diff suppressed because one or more lines are too long
62
lib/analyze-action.js
generated
62
lib/analyze-action.js
generated
@@ -12,8 +12,11 @@ const path = __importStar(require("path"));
|
|||||||
const core = __importStar(require("@actions/core"));
|
const core = __importStar(require("@actions/core"));
|
||||||
const actionsUtil = __importStar(require("./actions-util"));
|
const actionsUtil = __importStar(require("./actions-util"));
|
||||||
const analyze_1 = require("./analyze");
|
const analyze_1 = require("./analyze");
|
||||||
|
const api_client_1 = require("./api-client");
|
||||||
|
const codeql_1 = require("./codeql");
|
||||||
const config_utils_1 = require("./config-utils");
|
const config_utils_1 = require("./config-utils");
|
||||||
const logging_1 = require("./logging");
|
const logging_1 = require("./logging");
|
||||||
|
const repository_1 = require("./repository");
|
||||||
const upload_lib = __importStar(require("./upload-lib"));
|
const upload_lib = __importStar(require("./upload-lib"));
|
||||||
const util = __importStar(require("./util"));
|
const util = __importStar(require("./util"));
|
||||||
// eslint-disable-next-line import/no-commonjs
|
// eslint-disable-next-line import/no-commonjs
|
||||||
@@ -30,6 +33,63 @@ async function sendStatusReport(startedAt, stats, error) {
|
|||||||
};
|
};
|
||||||
await actionsUtil.sendStatusReport(statusReport);
|
await actionsUtil.sendStatusReport(statusReport);
|
||||||
}
|
}
|
||||||
|
async function uploadDatabases(repositoryNwo, config, apiDetails, logger) {
|
||||||
|
if (actionsUtil.getRequiredInput("upload-database") !== "true") {
|
||||||
|
logger.debug("Database upload disabled in workflow. Skipping upload.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Do nothing when not running against github.com
|
||||||
|
if (config.gitHubVersion.type !== util.GitHubVariant.DOTCOM) {
|
||||||
|
logger.debug("Not running against github.com. Skipping upload.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!(await actionsUtil.isAnalyzingDefaultBranch())) {
|
||||||
|
// We only want to upload a database if we are analyzing the default branch.
|
||||||
|
logger.debug("Not analyzing default branch. Skipping upload.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const client = api_client_1.getApiClient(apiDetails);
|
||||||
|
try {
|
||||||
|
await client.request("GET /repos/:owner/:repo/code-scanning/databases", {
|
||||||
|
owner: repositoryNwo.owner,
|
||||||
|
repo: repositoryNwo.repo,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
if (util.isHTTPError(e)) {
|
||||||
|
if (e.status === 404) {
|
||||||
|
logger.debug("Repository is not opted in to database uploads. Skipping upload.");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
logger.debug(`Skipping database upload due to unknown error: ${e}`);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const codeql = codeql_1.getCodeQL(config.codeQLCmd);
|
||||||
|
for (const language of config.languages) {
|
||||||
|
// Bundle the database up into a single zip file
|
||||||
|
const databasePath = util.getCodeQLDatabasePath(config, language);
|
||||||
|
const databaseBundlePath = `${databasePath}.zip`;
|
||||||
|
await codeql.databaseBundle(databasePath, databaseBundlePath);
|
||||||
|
// Upload the database bundle
|
||||||
|
const payload = fs.readFileSync(databaseBundlePath);
|
||||||
|
try {
|
||||||
|
await client.request(`PUT /repos/:owner/:repo/code-scanning/databases/${language}`, {
|
||||||
|
owner: repositoryNwo.owner,
|
||||||
|
repo: repositoryNwo.repo,
|
||||||
|
data: payload,
|
||||||
|
});
|
||||||
|
logger.debug(`Successfully uploaded database for ${language}`);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
// Log a warning but don't fail the workflow
|
||||||
|
logger.warning(`Failed to upload database for ${language}: ${e}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
async function run() {
|
async function run() {
|
||||||
const startedAt = new Date();
|
const startedAt = new Date();
|
||||||
let stats = undefined;
|
let stats = undefined;
|
||||||
@@ -66,6 +126,8 @@ async function run() {
|
|||||||
logger.info("Not uploading results");
|
logger.info("Not uploading results");
|
||||||
stats = { ...queriesStats };
|
stats = { ...queriesStats };
|
||||||
}
|
}
|
||||||
|
const repositoryNwo = repository_1.parseRepositoryNwo(util.getRequiredEnvParam("GITHUB_REPOSITORY"));
|
||||||
|
await uploadDatabases(repositoryNwo, config, apiDetails, logger);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
10
lib/codeql.js
generated
10
lib/codeql.js
generated
@@ -287,6 +287,7 @@ function setCodeQL(partialCodeql) {
|
|||||||
resolveQueries: resolveFunction(partialCodeql, "resolveQueries"),
|
resolveQueries: resolveFunction(partialCodeql, "resolveQueries"),
|
||||||
packDownload: resolveFunction(partialCodeql, "packDownload"),
|
packDownload: resolveFunction(partialCodeql, "packDownload"),
|
||||||
databaseCleanup: resolveFunction(partialCodeql, "databaseCleanup"),
|
databaseCleanup: resolveFunction(partialCodeql, "databaseCleanup"),
|
||||||
|
databaseBundle: resolveFunction(partialCodeql, "databaseBundle"),
|
||||||
databaseRunQueries: resolveFunction(partialCodeql, "databaseRunQueries"),
|
databaseRunQueries: resolveFunction(partialCodeql, "databaseRunQueries"),
|
||||||
databaseInterpretResults: resolveFunction(partialCodeql, "databaseInterpretResults"),
|
databaseInterpretResults: resolveFunction(partialCodeql, "databaseInterpretResults"),
|
||||||
};
|
};
|
||||||
@@ -535,6 +536,15 @@ function getCodeQLForCmd(cmd) {
|
|||||||
];
|
];
|
||||||
await runTool(cmd, codeqlArgs);
|
await runTool(cmd, codeqlArgs);
|
||||||
},
|
},
|
||||||
|
async databaseBundle(databasePath, outputFilePath) {
|
||||||
|
const args = [
|
||||||
|
"database",
|
||||||
|
"bundle",
|
||||||
|
databasePath,
|
||||||
|
`--output=${outputFilePath}`,
|
||||||
|
];
|
||||||
|
await new toolrunner.ToolRunner(cmd, args).exec();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function packWithVersionToString(pack) {
|
function packWithVersionToString(pack) {
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
5
lib/util.js
generated
5
lib/util.js
generated
@@ -408,4 +408,9 @@ function getRequiredEnvParam(paramName) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
exports.getRequiredEnvParam = getRequiredEnvParam;
|
exports.getRequiredEnvParam = getRequiredEnvParam;
|
||||||
|
function isHTTPError(arg) {
|
||||||
|
var _a;
|
||||||
|
return ((_a = arg) === null || _a === void 0 ? void 0 : _a.status) !== undefined && Number.isInteger(arg.status);
|
||||||
|
}
|
||||||
|
exports.isHTTPError = isHTTPError;
|
||||||
//# sourceMappingURL=util.js.map
|
//# sourceMappingURL=util.js.map
|
||||||
File diff suppressed because one or more lines are too long
@@ -8,7 +8,7 @@ import * as yaml from "js-yaml";
|
|||||||
|
|
||||||
import * as api from "./api-client";
|
import * as api from "./api-client";
|
||||||
import * as sharedEnv from "./shared-environment";
|
import * as sharedEnv from "./shared-environment";
|
||||||
import { getRequiredEnvParam, GITHUB_DOTCOM_URL } from "./util";
|
import { getRequiredEnvParam, GITHUB_DOTCOM_URL, isHTTPError } from "./util";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The utils in this module are meant to be run inside of the action only.
|
* The utils in this module are meant to be run inside of the action only.
|
||||||
@@ -576,15 +576,6 @@ export async function createStatusReportBase(
|
|||||||
return statusReport;
|
return statusReport;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface HTTPError {
|
|
||||||
status: number;
|
|
||||||
message?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isHTTPError(arg: any): arg is HTTPError {
|
|
||||||
return arg?.status !== undefined && Number.isInteger(arg.status);
|
|
||||||
}
|
|
||||||
|
|
||||||
const GENERIC_403_MSG =
|
const GENERIC_403_MSG =
|
||||||
"The repo on which this action is running is not opted-in to CodeQL code scanning.";
|
"The repo on which this action is running is not opted-in to CodeQL code scanning.";
|
||||||
const GENERIC_404_MSG =
|
const GENERIC_404_MSG =
|
||||||
@@ -691,3 +682,30 @@ export function getRelativeScriptPath(): string {
|
|||||||
const actionsDirectory = path.join(path.dirname(runnerTemp), "_actions");
|
const actionsDirectory = path.join(path.dirname(runnerTemp), "_actions");
|
||||||
return path.relative(actionsDirectory, __filename);
|
return path.relative(actionsDirectory, __filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reads the contents of GITHUB_EVENT_PATH as a JSON object
|
||||||
|
function getWorkflowEvent(): any {
|
||||||
|
const eventJsonFile = getRequiredEnvParam("GITHUB_EVENT_PATH");
|
||||||
|
try {
|
||||||
|
return JSON.parse(fs.readFileSync(eventJsonFile, "utf-8"));
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error(
|
||||||
|
`Unable to read workflow event JSON from ${eventJsonFile}: ${e}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is the version of the repository we are currently analyzing from the default branch,
|
||||||
|
// or alternatively from another branch or a pull request.
|
||||||
|
export async function isAnalyzingDefaultBranch(): Promise<boolean> {
|
||||||
|
// Get the current ref and trim and refs/heads/ prefix
|
||||||
|
let currentRef = await getRef();
|
||||||
|
currentRef = currentRef.startsWith("refs/heads/")
|
||||||
|
? currentRef.substr("refs/heads/".length)
|
||||||
|
: currentRef;
|
||||||
|
|
||||||
|
const event = getWorkflowEvent();
|
||||||
|
const defaultBranch = event?.repository?.default_branch;
|
||||||
|
|
||||||
|
return currentRef === defaultBranch;
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,8 +10,11 @@ import {
|
|||||||
QueriesStatusReport,
|
QueriesStatusReport,
|
||||||
runCleanup,
|
runCleanup,
|
||||||
} from "./analyze";
|
} from "./analyze";
|
||||||
|
import { getApiClient, GitHubApiDetails } from "./api-client";
|
||||||
|
import { getCodeQL } from "./codeql";
|
||||||
import { Config, getConfig } from "./config-utils";
|
import { Config, getConfig } from "./config-utils";
|
||||||
import { getActionsLogger } from "./logging";
|
import { getActionsLogger, Logger } from "./logging";
|
||||||
|
import { parseRepositoryNwo, RepositoryNwo } from "./repository";
|
||||||
import * as upload_lib from "./upload-lib";
|
import * as upload_lib from "./upload-lib";
|
||||||
import * as util from "./util";
|
import * as util from "./util";
|
||||||
|
|
||||||
@@ -49,6 +52,76 @@ async function sendStatusReport(
|
|||||||
await actionsUtil.sendStatusReport(statusReport);
|
await actionsUtil.sendStatusReport(statusReport);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function uploadDatabases(
|
||||||
|
repositoryNwo: RepositoryNwo,
|
||||||
|
config: Config,
|
||||||
|
apiDetails: GitHubApiDetails,
|
||||||
|
logger: Logger
|
||||||
|
): Promise<void> {
|
||||||
|
if (actionsUtil.getRequiredInput("upload-database") !== "true") {
|
||||||
|
logger.debug("Database upload disabled in workflow. Skipping upload.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do nothing when not running against github.com
|
||||||
|
if (config.gitHubVersion.type !== util.GitHubVariant.DOTCOM) {
|
||||||
|
logger.debug("Not running against github.com. Skipping upload.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(await actionsUtil.isAnalyzingDefaultBranch())) {
|
||||||
|
// We only want to upload a database if we are analyzing the default branch.
|
||||||
|
logger.debug("Not analyzing default branch. Skipping upload.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const client = getApiClient(apiDetails);
|
||||||
|
try {
|
||||||
|
await client.request("GET /repos/:owner/:repo/code-scanning/databases", {
|
||||||
|
owner: repositoryNwo.owner,
|
||||||
|
repo: repositoryNwo.repo,
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
if (util.isHTTPError(e)) {
|
||||||
|
if (e.status === 404) {
|
||||||
|
logger.debug(
|
||||||
|
"Repository is not opted in to database uploads. Skipping upload."
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
logger.debug(`Skipping database upload due to unknown error: ${e}`);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const codeql = getCodeQL(config.codeQLCmd);
|
||||||
|
for (const language of config.languages) {
|
||||||
|
// Bundle the database up into a single zip file
|
||||||
|
const databasePath = util.getCodeQLDatabasePath(config, language);
|
||||||
|
const databaseBundlePath = `${databasePath}.zip`;
|
||||||
|
await codeql.databaseBundle(databasePath, databaseBundlePath);
|
||||||
|
|
||||||
|
// Upload the database bundle
|
||||||
|
const payload = fs.readFileSync(databaseBundlePath);
|
||||||
|
try {
|
||||||
|
await client.request(
|
||||||
|
`PUT /repos/:owner/:repo/code-scanning/databases/${language}`,
|
||||||
|
{
|
||||||
|
owner: repositoryNwo.owner,
|
||||||
|
repo: repositoryNwo.repo,
|
||||||
|
data: payload,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
logger.debug(`Successfully uploaded database for ${language}`);
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
// Log a warning but don't fail the workflow
|
||||||
|
logger.warning(`Failed to upload database for ${language}: ${e}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
const startedAt = new Date();
|
const startedAt = new Date();
|
||||||
let stats: AnalysisStatusReport | undefined = undefined;
|
let stats: AnalysisStatusReport | undefined = undefined;
|
||||||
@@ -116,6 +189,11 @@ async function run() {
|
|||||||
logger.info("Not uploading results");
|
logger.info("Not uploading results");
|
||||||
stats = { ...queriesStats };
|
stats = { ...queriesStats };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const repositoryNwo = parseRepositoryNwo(
|
||||||
|
util.getRequiredEnvParam("GITHUB_REPOSITORY")
|
||||||
|
);
|
||||||
|
await uploadDatabases(repositoryNwo, config, apiDetails, logger);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(error.message);
|
core.setFailed(error.message);
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|||||||
@@ -99,6 +99,10 @@ export interface CodeQL {
|
|||||||
* Run 'codeql database cleanup'.
|
* Run 'codeql database cleanup'.
|
||||||
*/
|
*/
|
||||||
databaseCleanup(databasePath: string, cleanupLevel: string): Promise<void>;
|
databaseCleanup(databasePath: string, cleanupLevel: string): Promise<void>;
|
||||||
|
/**
|
||||||
|
* Run 'codeql database bundle'.
|
||||||
|
*/
|
||||||
|
databaseBundle(databasePath: string, outputFilePath: string): Promise<void>;
|
||||||
/**
|
/**
|
||||||
* Run 'codeql database run-queries'.
|
* Run 'codeql database run-queries'.
|
||||||
*/
|
*/
|
||||||
@@ -512,6 +516,7 @@ export function setCodeQL(partialCodeql: Partial<CodeQL>): CodeQL {
|
|||||||
resolveQueries: resolveFunction(partialCodeql, "resolveQueries"),
|
resolveQueries: resolveFunction(partialCodeql, "resolveQueries"),
|
||||||
packDownload: resolveFunction(partialCodeql, "packDownload"),
|
packDownload: resolveFunction(partialCodeql, "packDownload"),
|
||||||
databaseCleanup: resolveFunction(partialCodeql, "databaseCleanup"),
|
databaseCleanup: resolveFunction(partialCodeql, "databaseCleanup"),
|
||||||
|
databaseBundle: resolveFunction(partialCodeql, "databaseBundle"),
|
||||||
databaseRunQueries: resolveFunction(partialCodeql, "databaseRunQueries"),
|
databaseRunQueries: resolveFunction(partialCodeql, "databaseRunQueries"),
|
||||||
databaseInterpretResults: resolveFunction(
|
databaseInterpretResults: resolveFunction(
|
||||||
partialCodeql,
|
partialCodeql,
|
||||||
@@ -829,6 +834,18 @@ function getCodeQLForCmd(cmd: string): CodeQL {
|
|||||||
];
|
];
|
||||||
await runTool(cmd, codeqlArgs);
|
await runTool(cmd, codeqlArgs);
|
||||||
},
|
},
|
||||||
|
async databaseBundle(
|
||||||
|
databasePath: string,
|
||||||
|
outputFilePath: string
|
||||||
|
): Promise<void> {
|
||||||
|
const args = [
|
||||||
|
"database",
|
||||||
|
"bundle",
|
||||||
|
databasePath,
|
||||||
|
`--output=${outputFilePath}`,
|
||||||
|
];
|
||||||
|
await new toolrunner.ToolRunner(cmd, args).exec();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -478,3 +478,12 @@ export function getRequiredEnvParam(paramName: string): string {
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface HTTPError {
|
||||||
|
status: number;
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isHTTPError(arg: any): arg is HTTPError {
|
||||||
|
return arg?.status !== undefined && Number.isInteger(arg.status);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user