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

3
lib/actions-util.js generated
View file

@ -539,6 +539,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
}
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") {
@ -561,7 +562,7 @@ const INCOMPATIBLE_MSG = "CodeQL Action version is incompatible with the code sc
* Returns whether sending the status report was successful of not.
*/
async function sendStatusReport(statusReport) {
const gitHubVersion = await api.getGitHubVersion();
const gitHubVersion = await api.getGitHubVersionActionsOnly();
if ((0, util_1.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.