Restore compatibility with GHES 3.1: address code review comments

This commit is contained in:
Chuan-kai Lin 2022-03-14 15:44:16 -07:00
parent 39aa619399
commit ea5898d606
13 changed files with 23 additions and 19 deletions

View file

@ -696,6 +696,7 @@ export async function createStatusReportBase(
}
if ("RUNNER_ARCH" in process.env) {
// RUNNER_ARCH is available only in GHES 3.4 and later
// Values other than X86, X64, ARM, or ARM64 are discarded server side
statusReport.runner_arch = process.env["RUNNER_ARCH"];
}
if (runnerOs === "Windows" || runnerOs === "macOS") {
@ -726,7 +727,7 @@ const INCOMPATIBLE_MSG =
export async function sendStatusReport<S extends StatusReportBase>(
statusReport: S
): Promise<boolean> {
const gitHubVersion = await api.getGitHubVersion();
const gitHubVersion = await api.getGitHubVersionActionsOnly();
if (isGitHubGhesVersionBelow(gitHubVersion, "3.2.0")) {
// GHES 3.1 and earlier versions reject unexpected properties, which means
// that they will reject status reports with newly added properties.