Restore compatibility with GHES 3.1: address code review comments
This commit is contained in:
parent
39aa619399
commit
ea5898d606
13 changed files with 23 additions and 19 deletions
|
|
@ -4,7 +4,9 @@
|
||||||
|
|
||||||
- Update default CodeQL bundle version to 2.8.3.
|
- Update default CodeQL bundle version to 2.8.3.
|
||||||
- The CodeQL runner is now deprecated and no longer being released. For more information, see [CodeQL runner deprecation](https://github.blog/changelog/2021-09-21-codeql-runner-deprecation/).
|
- The CodeQL runner is now deprecated and no longer being released. For more information, see [CodeQL runner deprecation](https://github.blog/changelog/2021-09-21-codeql-runner-deprecation/).
|
||||||
- Fix a bug where actions would fail when used with GHES 3.3 or earlier. [#978](https://github.com/github/codeql-action/pull/978)
|
- Fix two bugs that cause action failures with GHES 3.3 or earlier. [#978](https://github.com/github/codeql-action/pull/978)
|
||||||
|
- Fix `not a permitted key` invalid requests with GHES 3.1 or earlier
|
||||||
|
- Fix `RUNNER_ARCH environment variable must be set` errors with GHES 3.3 or earlier
|
||||||
|
|
||||||
## 1.1.4 - 07 Mar 2022
|
## 1.1.4 - 07 Mar 2022
|
||||||
|
|
||||||
|
|
|
||||||
3
lib/actions-util.js
generated
3
lib/actions-util.js
generated
|
|
@ -539,6 +539,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, cause
|
||||||
}
|
}
|
||||||
if ("RUNNER_ARCH" in process.env) {
|
if ("RUNNER_ARCH" in process.env) {
|
||||||
// RUNNER_ARCH is available only in GHES 3.4 and later
|
// 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"];
|
statusReport.runner_arch = process.env["RUNNER_ARCH"];
|
||||||
}
|
}
|
||||||
if (runnerOs === "Windows" || runnerOs === "macOS") {
|
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.
|
* Returns whether sending the status report was successful of not.
|
||||||
*/
|
*/
|
||||||
async function sendStatusReport(statusReport) {
|
async function sendStatusReport(statusReport) {
|
||||||
const gitHubVersion = await api.getGitHubVersion();
|
const gitHubVersion = await api.getGitHubVersionActionsOnly();
|
||||||
if ((0, util_1.isGitHubGhesVersionBelow)(gitHubVersion, "3.2.0")) {
|
if ((0, util_1.isGitHubGhesVersionBelow)(gitHubVersion, "3.2.0")) {
|
||||||
// GHES 3.1 and earlier versions reject unexpected properties, which means
|
// GHES 3.1 and earlier versions reject unexpected properties, which means
|
||||||
// that they will reject status reports with newly added properties.
|
// that they will reject status reports with newly added properties.
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
8
lib/api-client.js
generated
8
lib/api-client.js
generated
|
|
@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.getGitHubVersion = exports.getActionsApiClient = exports.getApiClient = exports.DisallowedAPIVersionReason = void 0;
|
exports.getGitHubVersionActionsOnly = exports.getActionsApiClient = exports.getApiClient = exports.DisallowedAPIVersionReason = void 0;
|
||||||
const path = __importStar(require("path"));
|
const path = __importStar(require("path"));
|
||||||
const githubUtils = __importStar(require("@actions/github/lib/utils"));
|
const githubUtils = __importStar(require("@actions/github/lib/utils"));
|
||||||
const retry = __importStar(require("@octokit/plugin-retry"));
|
const retry = __importStar(require("@octokit/plugin-retry"));
|
||||||
|
|
@ -76,11 +76,11 @@ let cachedGitHubVersion = undefined;
|
||||||
* Report the GitHub server version. This is a wrapper around
|
* Report the GitHub server version. This is a wrapper around
|
||||||
* util.getGitHubVersion() that automatically supplies GitHub API details using
|
* util.getGitHubVersion() that automatically supplies GitHub API details using
|
||||||
* GitHub Action inputs. If you need to get the GitHub server version from the
|
* GitHub Action inputs. If you need to get the GitHub server version from the
|
||||||
* action runner, please call util.getGitHubVersion() instead.
|
* Runner, please call util.getGitHubVersion() instead.
|
||||||
*
|
*
|
||||||
* @returns GitHub version
|
* @returns GitHub version
|
||||||
*/
|
*/
|
||||||
async function getGitHubVersion() {
|
async function getGitHubVersionActionsOnly() {
|
||||||
if (!util.isActions) {
|
if (!util.isActions) {
|
||||||
throw new Error("This getGitHubVersion() function works only in an action");
|
throw new Error("This getGitHubVersion() function works only in an action");
|
||||||
}
|
}
|
||||||
|
|
@ -89,5 +89,5 @@ async function getGitHubVersion() {
|
||||||
}
|
}
|
||||||
return cachedGitHubVersion;
|
return cachedGitHubVersion;
|
||||||
}
|
}
|
||||||
exports.getGitHubVersion = getGitHubVersion;
|
exports.getGitHubVersionActionsOnly = getGitHubVersionActionsOnly;
|
||||||
//# sourceMappingURL=api-client.js.map
|
//# sourceMappingURL=api-client.js.map
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,uEAAyD;AACzD,6DAA+C;AAC/C,0EAAgD;AAEhD,iDAAkD;AAClD,6CAA+B;AAC/B,iCAAqE;AAErE,8CAA8C;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAEvC,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IACpC,+FAAc,CAAA;IACd,+FAAc,CAAA;AAChB,CAAC,EAHW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAGrC;AAeM,MAAM,YAAY,GAAG,UAC1B,UAAoC,EACpC,EAAE,aAAa,GAAG,KAAK,EAAE,GAAG,EAAE;IAE9B,MAAM,IAAI,GACR,CAAC,aAAa,IAAI,UAAU,CAAC,gBAAgB,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC;IACpE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||||||
externalRepoAuth: (0, actions_util_1.getOptionalInput)("external-repository-token"),
|
externalRepoAuth: (0, actions_util_1.getOptionalInput)("external-repository-token"),
|
||||||
url: (0, util_1.getRequiredEnvParam)("GITHUB_SERVER_URL"),
|
url: (0, util_1.getRequiredEnvParam)("GITHUB_SERVER_URL"),
|
||||||
};
|
};
|
||||||
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
const gitHubVersion = await (0, api_client_1.getGitHubVersionActionsOnly)();
|
||||||
(0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger, util_1.Mode.actions);
|
(0, util_1.checkGitHubVersionInRange)(gitHubVersion, logger, util_1.Mode.actions);
|
||||||
const repositoryNwo = (0, repository_1.parseRepositoryNwo)((0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY"));
|
const repositoryNwo = (0, repository_1.parseRepositoryNwo)((0, util_1.getRequiredEnvParam)("GITHUB_REPOSITORY"));
|
||||||
const featureFlags = new feature_flags_1.GitHubFeatureFlags(gitHubVersion, apiDetails, repositoryNwo, logger);
|
const featureFlags = new feature_flags_1.GitHubFeatureFlags(gitHubVersion, apiDetails, repositoryNwo, logger);
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
2
lib/upload-sarif-action.js
generated
2
lib/upload-sarif-action.js
generated
|
|
@ -47,7 +47,7 @@ async function run() {
|
||||||
auth: actionsUtil.getRequiredInput("token"),
|
auth: actionsUtil.getRequiredInput("token"),
|
||||||
url: (0, util_1.getRequiredEnvParam)("GITHUB_SERVER_URL"),
|
url: (0, util_1.getRequiredEnvParam)("GITHUB_SERVER_URL"),
|
||||||
};
|
};
|
||||||
const gitHubVersion = await (0, api_client_1.getGitHubVersion)();
|
const gitHubVersion = await (0, api_client_1.getGitHubVersionActionsOnly)();
|
||||||
const uploadResult = await upload_lib.uploadFromActions(actionsUtil.getRequiredInput("sarif_file"), gitHubVersion, apiDetails, (0, logging_1.getActionsLogger)());
|
const uploadResult = await upload_lib.uploadFromActions(actionsUtil.getRequiredInput("sarif_file"), gitHubVersion, apiDetails, (0, logging_1.getActionsLogger)());
|
||||||
core.setOutput("sarif-id", uploadResult.sarifID);
|
core.setOutput("sarif-id", uploadResult.sarifID);
|
||||||
if (actionsUtil.getRequiredInput("wait-for-processing") === "true") {
|
if (actionsUtil.getRequiredInput("wait-for-processing") === "true") {
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"upload-sarif-action.js","sourceRoot":"","sources":["../src/upload-sarif-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,6CAAgD;AAChD,uCAA6C;AAC7C,6CAAkD;AAClD,yDAA2C;AAC3C,iCAA0E;AAE1E,8CAA8C;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAMvC,KAAK,UAAU,uBAAuB,CACpC,SAAe,EACf,WAA0C;IAE1C,MAAM,gBAAgB,GAAG,MAAM,WAAW,CAAC,sBAAsB,CAC/D,cAAc,EACd,SAAS,EACT,SAAS,CACV,CAAC;IACF,MAAM,YAAY,GAA4B;QAC5C,GAAG,gBAAgB;QACnB,GAAG,WAAW;KACf,CAAC;IACF,MAAM,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACnD,CAAC;AAED,KAAK,UAAU,GAAG;IAChB,IAAA,4BAAqB,EAAC,WAAI,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,IACE,CAAC,CAAC,MAAM,WAAW,CAAC,gBAAgB,CAClC,MAAM,WAAW,CAAC,sBAAsB,CACtC,cAAc,EACd,UAAU,EACV,SAAS,CACV,CACF,CAAC,EACF;QACA,OAAO;KACR;IAED,IAAI;QACF,MAAM,UAAU,GAAG;YACjB,IAAI,EAAE,WAAW,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAC3C,GAAG,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AED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,sCAAsC,KAAK,EAAE,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
{"version":3,"file":"upload-sarif-action.js","sourceRoot":"","sources":["../src/upload-sarif-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,6CAA2D;AAC3D,uCAA6C;AAC7C,6CAAkD;AAClD,yDAA2C;AAC3C,iCAA0E;AAE1E,8CAA8C;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAMvC,KAAK,UAAU,uBAAuB,CACpC,SAAe,EACf,WAA0C;IAE1C,MAAM,gBAAgB,GAAG,MAAM,WAAW,CAAC,sBAAsB,CAC/D,cAAc,EACd,SAAS,EACT,SAAS,CACV,CAAC;IACF,MAAM,YAAY,GAA4B;QAC5C,GAAG,gBAAgB;QACnB,GAAG,WAAW;KACf,CAAC;IACF,MAAM,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACnD,CAAC;AAED,KAAK,UAAU,GAAG;IAChB,IAAA,4BAAqB,EAAC,WAAI,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,IACE,CAAC,CAAC,MAAM,WAAW,CAAC,gBAAgB,CAClC,MAAM,WAAW,CAAC,sBAAsB,CACtC,cAAc,EACd,UAAU,EACV,SAAS,CACV,CACF,CAAC,EACF;QACA,OAAO;KACR;IAED,IAAI;QACF,MAAM,UAAU,GAAG;YACjB,IAAI,EAAE,WAAW,CAAC,gBAAgB,CAAC,OAAO,CAAC;YAC3C,GAAG,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AED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,sCAAsC,KAAK,EAAE,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;KACpB;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"}
|
||||||
|
|
@ -696,6 +696,7 @@ export async function createStatusReportBase(
|
||||||
}
|
}
|
||||||
if ("RUNNER_ARCH" in process.env) {
|
if ("RUNNER_ARCH" in process.env) {
|
||||||
// RUNNER_ARCH is available only in GHES 3.4 and later
|
// 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"];
|
statusReport.runner_arch = process.env["RUNNER_ARCH"];
|
||||||
}
|
}
|
||||||
if (runnerOs === "Windows" || runnerOs === "macOS") {
|
if (runnerOs === "Windows" || runnerOs === "macOS") {
|
||||||
|
|
@ -726,7 +727,7 @@ const INCOMPATIBLE_MSG =
|
||||||
export async function sendStatusReport<S extends StatusReportBase>(
|
export async function sendStatusReport<S extends StatusReportBase>(
|
||||||
statusReport: S
|
statusReport: S
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
const gitHubVersion = await api.getGitHubVersion();
|
const gitHubVersion = await api.getGitHubVersionActionsOnly();
|
||||||
if (isGitHubGhesVersionBelow(gitHubVersion, "3.2.0")) {
|
if (isGitHubGhesVersionBelow(gitHubVersion, "3.2.0")) {
|
||||||
// GHES 3.1 and earlier versions reject unexpected properties, which means
|
// GHES 3.1 and earlier versions reject unexpected properties, which means
|
||||||
// that they will reject status reports with newly added properties.
|
// that they will reject status reports with newly added properties.
|
||||||
|
|
|
||||||
|
|
@ -79,11 +79,11 @@ let cachedGitHubVersion: GitHubVersion | undefined = undefined;
|
||||||
* Report the GitHub server version. This is a wrapper around
|
* Report the GitHub server version. This is a wrapper around
|
||||||
* util.getGitHubVersion() that automatically supplies GitHub API details using
|
* util.getGitHubVersion() that automatically supplies GitHub API details using
|
||||||
* GitHub Action inputs. If you need to get the GitHub server version from the
|
* GitHub Action inputs. If you need to get the GitHub server version from the
|
||||||
* action runner, please call util.getGitHubVersion() instead.
|
* Runner, please call util.getGitHubVersion() instead.
|
||||||
*
|
*
|
||||||
* @returns GitHub version
|
* @returns GitHub version
|
||||||
*/
|
*/
|
||||||
export async function getGitHubVersion(): Promise<GitHubVersion> {
|
export async function getGitHubVersionActionsOnly(): Promise<GitHubVersion> {
|
||||||
if (!util.isActions) {
|
if (!util.isActions) {
|
||||||
throw new Error("This getGitHubVersion() function works only in an action");
|
throw new Error("This getGitHubVersion() function works only in an action");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import {
|
||||||
StatusReportBase,
|
StatusReportBase,
|
||||||
validateWorkflow,
|
validateWorkflow,
|
||||||
} from "./actions-util";
|
} from "./actions-util";
|
||||||
import { getGitHubVersion } from "./api-client";
|
import { getGitHubVersionActionsOnly } from "./api-client";
|
||||||
import { CodeQL, CODEQL_VERSION_NEW_TRACING } from "./codeql";
|
import { CodeQL, CODEQL_VERSION_NEW_TRACING } from "./codeql";
|
||||||
import * as configUtils from "./config-utils";
|
import * as configUtils from "./config-utils";
|
||||||
import { GitHubFeatureFlags } from "./feature-flags";
|
import { GitHubFeatureFlags } from "./feature-flags";
|
||||||
|
|
@ -135,7 +135,7 @@ async function run() {
|
||||||
url: getRequiredEnvParam("GITHUB_SERVER_URL"),
|
url: getRequiredEnvParam("GITHUB_SERVER_URL"),
|
||||||
};
|
};
|
||||||
|
|
||||||
const gitHubVersion = await getGitHubVersion();
|
const gitHubVersion = await getGitHubVersionActionsOnly();
|
||||||
checkGitHubVersionInRange(gitHubVersion, logger, Mode.actions);
|
checkGitHubVersionInRange(gitHubVersion, logger, Mode.actions);
|
||||||
|
|
||||||
const repositoryNwo = parseRepositoryNwo(
|
const repositoryNwo = parseRepositoryNwo(
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
|
||||||
import * as actionsUtil from "./actions-util";
|
import * as actionsUtil from "./actions-util";
|
||||||
import { getGitHubVersion } from "./api-client";
|
import { getGitHubVersionActionsOnly } from "./api-client";
|
||||||
import { getActionsLogger } from "./logging";
|
import { getActionsLogger } from "./logging";
|
||||||
import { parseRepositoryNwo } from "./repository";
|
import { parseRepositoryNwo } from "./repository";
|
||||||
import * as upload_lib from "./upload-lib";
|
import * as upload_lib from "./upload-lib";
|
||||||
|
|
@ -51,7 +51,7 @@ async function run() {
|
||||||
url: getRequiredEnvParam("GITHUB_SERVER_URL"),
|
url: getRequiredEnvParam("GITHUB_SERVER_URL"),
|
||||||
};
|
};
|
||||||
|
|
||||||
const gitHubVersion = await getGitHubVersion();
|
const gitHubVersion = await getGitHubVersionActionsOnly();
|
||||||
|
|
||||||
const uploadResult = await upload_lib.uploadFromActions(
|
const uploadResult = await upload_lib.uploadFromActions(
|
||||||
actionsUtil.getRequiredInput("sarif_file"),
|
actionsUtil.getRequiredInput("sarif_file"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue