Skip to content

Commit 3b25789

Browse files
committed
Add runner image version to status report
1 parent 7dcb3e5 commit 3b25789

6 files changed

Lines changed: 18 additions & 2 deletions

File tree

lib/status-report.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/status-report.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/status-report.test.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/status-report.test.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/status-report.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ test("createStatusReportBase", async (t) => {
1919
process.env["GITHUB_RUN_ATTEMPT"] = "2";
2020
process.env["GITHUB_RUN_ID"] = "100";
2121
process.env["GITHUB_SHA"] = "a".repeat(40);
22+
process.env["ImageVersion"] = "2023.05.19.1";
2223
process.env["RUNNER_OS"] = "macOS";
2324

2425
const getRequiredInput = sinon.stub(actionsUtil, "getRequiredInput");
@@ -48,6 +49,7 @@ test("createStatusReportBase", async (t) => {
4849
t.is(typeof statusReport.job_run_uuid, "string");
4950
t.is(statusReport.ref, process.env["GITHUB_REF"]);
5051
t.is(statusReport.runner_available_disk_space_bytes, 100);
52+
t.is(statusReport.runner_image_version, process.env["ImageVersion"]);
5153
t.is(statusReport.runner_os, process.env["RUNNER_OS"]);
5254
t.is(statusReport.started_at, process.env[EnvVar.WORKFLOW_STARTED_AT]!);
5355
t.is(statusReport.status, "failure");

src/status-report.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ export interface StatusReportBase {
8989
runner_arch?: string;
9090
/** Available disk space on the runner, in bytes. */
9191
runner_available_disk_space_bytes: number;
92+
/**
93+
* Version of the runner image, for workflows running on GitHub-hosted runners. Absent otherwise.
94+
*/
95+
runner_image_version?: string;
9296
/** Action runner operating system (context runner.os). */
9397
runner_os: string;
9498
/** Action runner operating system release (x.y.z from os.release()). */
@@ -240,6 +244,10 @@ export async function createStatusReportBase(
240244
if (codeQlCliVersion !== undefined) {
241245
statusReport.codeql_version = codeQlCliVersion;
242246
}
247+
const imageVersion = process.env["ImageVersion"];
248+
if (imageVersion) {
249+
statusReport.runner_image_version = imageVersion;
250+
}
243251

244252
return statusReport;
245253
}

0 commit comments

Comments
 (0)