Skip to content

Commit f9442c4

Browse files
committed
Include computed tools value in computed_inputs
1 parent be24c11 commit f9442c4

5 files changed

Lines changed: 20 additions & 0 deletions

File tree

lib/entry-points.js

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

src/init-action.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ async function sendCompletedStatusReport(
166166
workflow_languages: workflowLanguages || "",
167167
};
168168

169+
if (toolsInput !== undefined) {
170+
initStatusReport.computed_inputs.tools = toolsInput;
171+
}
172+
169173
const initToolsDownloadFields: InitToolsDownloadFields = {};
170174

171175
if (toolsDownloadStatusReport?.downloadDurationMs !== undefined) {

src/setup-codeql-action.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ async function sendCompletedStatusReport(
7676
workflow_languages: "",
7777
};
7878

79+
if (toolsInput !== undefined) {
80+
initStatusReport.computed_inputs.tools = toolsInput;
81+
}
82+
7983
const initToolsDownloadFields: InitToolsDownloadFields = {};
8084

8185
if (toolsDownloadStatusReport?.downloadDurationMs !== undefined) {

src/status-report.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ test.serial("createStatusReportBase", async (t) => {
7171
t.is(statusReport.build_mode, BuildMode.None);
7272
t.is(statusReport.cause, "failure cause");
7373
t.is(statusReport.commit_oid, process.env["GITHUB_SHA"]!);
74+
t.deepEqual(statusReport.computed_inputs, {});
7475
t.is(statusReport.exception, "exception stack trace");
7576
t.is(statusReport.job_name, process.env["GITHUB_JOB"] || "");
7677
t.is(typeof statusReport.job_run_uuid, "string");

src/status-report.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
} from "./actions-util";
1414
import { getAnalysisKey, getApiClient } from "./api-client";
1515
import type { Config } from "./config/action-config";
16+
import type { ComputedInput, InputName } from "./config/inputs";
1617
import { parseRegistriesWithoutCredentials } from "./config/pack-registries";
1718
import type { DependencyCacheRestoreStatusReport } from "./dependency-caching";
1819
import { DocUrl } from "./doc-url";
@@ -122,6 +123,8 @@ export interface StatusReportBase {
122123
commit_oid: string;
123124
/** Time this action completed, or undefined if not yet completed. */
124125
completed_at?: string;
126+
/** A mapping of input names to their computed values. */
127+
computed_inputs: Partial<Record<InputName, ComputedInput>>;
125128
/** Stack trace of the failure (or undefined if status is not failure). */
126129
exception?: string;
127130
/** Whether this is a first-party (CodeQL) run of the action. */
@@ -316,6 +319,7 @@ export async function createStatusReportBase(
316319
analysis_key,
317320
build_mode: config?.buildMode,
318321
commit_oid: commitOid,
322+
computed_inputs: {},
319323
first_party_analysis: isFirstPartyAnalysis(actionName),
320324
job_name: jobName,
321325
job_run_uuid: jobRunUUID,

0 commit comments

Comments
 (0)