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

8
lib/api-client.js generated
View file

@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
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 githubUtils = __importStar(require("@actions/github/lib/utils"));
const retry = __importStar(require("@octokit/plugin-retry"));
@ -76,11 +76,11 @@ let cachedGitHubVersion = undefined;
* Report the GitHub server version. This is a wrapper around
* util.getGitHubVersion() that automatically supplies GitHub API details using
* 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
*/
async function getGitHubVersion() {
async function getGitHubVersionActionsOnly() {
if (!util.isActions) {
throw new Error("This getGitHubVersion() function works only in an action");
}
@ -89,5 +89,5 @@ async function getGitHubVersion() {
}
return cachedGitHubVersion;
}
exports.getGitHubVersion = getGitHubVersion;
exports.getGitHubVersionActionsOnly = getGitHubVersionActionsOnly;
//# sourceMappingURL=api-client.js.map