Add a debug log for the feature flag API response

This commit is contained in:
Henry Mercer 2023-01-11 19:10:22 +00:00
parent 2f7b9a1280
commit e8c12e1f7d
3 changed files with 14 additions and 4 deletions

6
lib/feature-flags.js generated
View file

@ -244,7 +244,10 @@ class GitHubFeatureFlags {
owner: this.repositoryNwo.owner,
repo: this.repositoryNwo.repo,
});
return response.data;
const remoteFlags = response.data;
this.logger.debug("Loaded the following default values for the feature flags from the Code Scanning API: " +
`${JSON.stringify(remoteFlags)}`);
return remoteFlags;
}
catch (e) {
if (util.isHTTPError(e) && e.status === 403) {
@ -252,6 +255,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}`);
return {};
}
else {
// Some features, such as `ml_powered_queries_enabled` affect the produced alerts.