Include CodeQL CLI and action versions in status reports
This commit is contained in:
parent
d0ee2b4276
commit
f60bb5cc38
12 changed files with 124 additions and 17 deletions
7
lib/actions-util.js
generated
7
lib/actions-util.js
generated
|
|
@ -30,6 +30,8 @@ const yaml = __importStar(require("js-yaml"));
|
|||
const api = __importStar(require("./api-client"));
|
||||
const sharedEnv = __importStar(require("./shared-environment"));
|
||||
const util_1 = require("./util");
|
||||
// eslint-disable-next-line import/no-commonjs
|
||||
const pkg = require("../package.json");
|
||||
/**
|
||||
* The utils in this module are meant to be run inside of the action only.
|
||||
* Code paths from the runner should not enter this module.
|
||||
|
|
@ -500,6 +502,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
|
|||
core.exportVariable(sharedEnv.CODEQL_WORKFLOW_STARTED_AT, workflowStartedAt);
|
||||
}
|
||||
const runnerOs = (0, util_1.getRequiredEnvParam)("RUNNER_OS");
|
||||
const codeQlCliVersion = (0, util_1.getCachedCodeQlVersion)();
|
||||
// If running locally then the GITHUB_ACTION_REF cannot be trusted as it may be for the previous action
|
||||
// See https://github.com/actions/runner/issues/803
|
||||
const actionRef = isRunningLocalAction()
|
||||
|
|
@ -519,6 +522,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
|
|||
action_started_at: actionStartedAt.toISOString(),
|
||||
status,
|
||||
runner_os: runnerOs,
|
||||
action_version: pkg.version,
|
||||
};
|
||||
// Add optional parameters
|
||||
if (cause) {
|
||||
|
|
@ -545,6 +549,9 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
|
|||
if (runnerOs === "Windows" || runnerOs === "macOS") {
|
||||
statusReport.runner_os_release = os.release();
|
||||
}
|
||||
if (codeQlCliVersion !== undefined) {
|
||||
statusReport.codeql_cli_version = codeQlCliVersion;
|
||||
}
|
||||
return statusReport;
|
||||
}
|
||||
exports.createStatusReportBase = createStatusReportBase;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue