mirror of
https://github.com/github/codeql-action.git
synced 2026-05-01 19:30:49 +00:00
Add support for boolean repository properties
This commit is contained in:
Generated
+15
-3
@@ -104279,9 +104279,22 @@ function getUnknownLanguagesError(languages) {
|
||||
|
||||
// src/feature-flags/properties.ts
|
||||
var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => {
|
||||
RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay";
|
||||
RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries";
|
||||
return RepositoryPropertyName2;
|
||||
})(RepositoryPropertyName || {});
|
||||
function isKnownPropertyName(value) {
|
||||
return Object.values(RepositoryPropertyName).includes(
|
||||
value
|
||||
);
|
||||
}
|
||||
var mapRepositoryProperties = {
|
||||
["github-codeql-disable-overlay" /* DISABLE_OVERLAY */]: (value) => value === "true",
|
||||
["github-codeql-extra-queries" /* EXTRA_QUERIES */]: (value) => value
|
||||
};
|
||||
function setProperty2(properties, name, value) {
|
||||
properties[name] = mapRepositoryProperties[name](value);
|
||||
}
|
||||
async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) {
|
||||
if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */) {
|
||||
return {};
|
||||
@@ -104297,7 +104310,6 @@ async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) {
|
||||
logger.debug(
|
||||
`Retrieved ${remoteProperties.length} repository properties: ${remoteProperties.map((p) => p.property_name).join(", ")}`
|
||||
);
|
||||
const knownProperties = new Set(Object.values(RepositoryPropertyName));
|
||||
const properties = {};
|
||||
for (const property of remoteProperties) {
|
||||
if (property.property_name === void 0) {
|
||||
@@ -104305,8 +104317,8 @@ async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) {
|
||||
`Expected property object to have a 'property_name', but got: ${JSON.stringify(property)}`
|
||||
);
|
||||
}
|
||||
if (knownProperties.has(property.property_name)) {
|
||||
properties[property.property_name] = property.value;
|
||||
if (isKnownPropertyName(property.property_name)) {
|
||||
setProperty2(properties, property.property_name, property.value);
|
||||
}
|
||||
}
|
||||
if (Object.keys(properties).length === 0) {
|
||||
|
||||
Reference in New Issue
Block a user