mirror of
https://github.com/github/codeql-action.git
synced 2026-01-03 13:10:06 +08:00
Compare commits
4 Commits
redsun82/w
...
NlightNFot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a6a1c8e2ba | ||
|
|
420fe33409 | ||
|
|
e93bd1c127 | ||
|
|
2d27f9b8e3 |
4
lib/api-client.js
generated
4
lib/api-client.js
generated
@@ -44,6 +44,7 @@ const githubUtils = __importStar(require("@actions/github/lib/utils"));
|
||||
const retry = __importStar(require("@octokit/plugin-retry"));
|
||||
const console_log_level_1 = __importDefault(require("console-log-level"));
|
||||
const actions_util_1 = require("./actions-util");
|
||||
const logging_1 = require("./logging");
|
||||
const repository_1 = require("./repository");
|
||||
const util_1 = require("./util");
|
||||
const GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version";
|
||||
@@ -106,6 +107,9 @@ async function getGitHubVersion() {
|
||||
if (cachedGitHubVersion === undefined) {
|
||||
cachedGitHubVersion = await getGitHubVersionFromApi(getApiClient(), getApiDetails());
|
||||
}
|
||||
(0, logging_1.getRunnerLogger)(true).info(JSON.stringify(cachedGitHubVersion));
|
||||
(0, logging_1.getRunnerLogger)(true).info(getApiDetails().url);
|
||||
(0, logging_1.getRunnerLogger)(true).info(getApiDetails().apiURL);
|
||||
return cachedGitHubVersion;
|
||||
}
|
||||
/**
|
||||
|
||||
File diff suppressed because one or more lines are too long
5
lib/feature-flags.js
generated
5
lib/feature-flags.js
generated
@@ -352,7 +352,8 @@ class GitHubFeatureFlags {
|
||||
}
|
||||
async loadApiResponse() {
|
||||
// Do nothing when not running against github.com
|
||||
if (this.gitHubVersion.type !== util.GitHubVariant.DOTCOM) {
|
||||
if (this.gitHubVersion.type !== util.GitHubVariant.DOTCOM &&
|
||||
this.gitHubVersion.type !== util.GitHubVariant.GHE_DOTCOM) {
|
||||
this.logger.debug("Not running against github.com. Disabling all toggleable features.");
|
||||
this.hasAccessedRemoteFeatureFlags = false;
|
||||
return {};
|
||||
@@ -373,6 +374,7 @@ class GitHubFeatureFlags {
|
||||
this.logger.debug(` ${feature}: ${value}`);
|
||||
}
|
||||
this.hasAccessedRemoteFeatureFlags = true;
|
||||
this.logger.info(`[DEBUG] Got remote flags: ${JSON.stringify(remoteFlags)}`);
|
||||
return remoteFlags;
|
||||
}
|
||||
catch (e) {
|
||||
@@ -381,6 +383,7 @@ class GitHubFeatureFlags {
|
||||
"As a result, it will not be opted into any experimental features. " +
|
||||
"This could be because the Action is running on a pull request from a fork. If not, " +
|
||||
`please ensure the Action has the 'security-events: write' permission. Details: ${e.message}`);
|
||||
this.logger.info(`[DEBUG] Got HTTP error while retrieving remote flags`);
|
||||
this.hasAccessedRemoteFeatureFlags = false;
|
||||
return {};
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -4,6 +4,7 @@ import * as retry from "@octokit/plugin-retry";
|
||||
import consoleLogLevel from "console-log-level";
|
||||
|
||||
import { getActionVersion, getRequiredInput } from "./actions-util";
|
||||
import { getRunnerLogger } from "./logging";
|
||||
import { parseRepositoryNwo } from "./repository";
|
||||
import {
|
||||
ConfigurationError,
|
||||
@@ -116,6 +117,9 @@ export async function getGitHubVersion(): Promise<GitHubVersion> {
|
||||
getApiDetails(),
|
||||
);
|
||||
}
|
||||
getRunnerLogger(true).info(JSON.stringify(cachedGitHubVersion));
|
||||
getRunnerLogger(true).info(getApiDetails().url);
|
||||
getRunnerLogger(true).info(getApiDetails().apiURL);
|
||||
return cachedGitHubVersion;
|
||||
}
|
||||
|
||||
|
||||
@@ -491,7 +491,10 @@ class GitHubFeatureFlags {
|
||||
|
||||
private async loadApiResponse(): Promise<GitHubFeatureFlagsApiResponse> {
|
||||
// Do nothing when not running against github.com
|
||||
if (this.gitHubVersion.type !== util.GitHubVariant.DOTCOM) {
|
||||
if (
|
||||
this.gitHubVersion.type !== util.GitHubVariant.DOTCOM &&
|
||||
this.gitHubVersion.type !== util.GitHubVariant.GHE_DOTCOM
|
||||
) {
|
||||
this.logger.debug(
|
||||
"Not running against github.com. Disabling all toggleable features.",
|
||||
);
|
||||
@@ -522,6 +525,9 @@ class GitHubFeatureFlags {
|
||||
this.logger.debug(` ${feature}: ${value}`);
|
||||
}
|
||||
this.hasAccessedRemoteFeatureFlags = true;
|
||||
this.logger.info(
|
||||
`[DEBUG] Got remote flags: ${JSON.stringify(remoteFlags)}`,
|
||||
);
|
||||
return remoteFlags;
|
||||
} catch (e) {
|
||||
if (util.isHTTPError(e) && e.status === 403) {
|
||||
@@ -531,6 +537,9 @@ class GitHubFeatureFlags {
|
||||
"This could be because the Action is running on a pull request from a fork. If not, " +
|
||||
`please ensure the Action has the 'security-events: write' permission. Details: ${e.message}`,
|
||||
);
|
||||
this.logger.info(
|
||||
`[DEBUG] Got HTTP error while retrieving remote flags`,
|
||||
);
|
||||
this.hasAccessedRemoteFeatureFlags = false;
|
||||
return {};
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user