Merge pull request #3570 from github/mbg/repo-props/warn-on-unexpected-props

Emit warning for unrecognised repo properties with our common prefix
This commit is contained in:
Michael B. Gale
2026-03-13 11:13:21 +00:00
committed by GitHub
3 changed files with 71 additions and 1 deletions
+10
View File
@@ -104293,6 +104293,7 @@ function getUnknownLanguagesError(languages) {
}
// src/feature-flags/properties.ts
var GITHUB_CODEQL_PROPERTY_PREFIX = "github-codeql-";
var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => {
RepositoryPropertyName2["DISABLE_OVERLAY"] = "github-codeql-disable-overlay";
RepositoryPropertyName2["EXTRA_QUERIES"] = "github-codeql-extra-queries";
@@ -104329,6 +104330,7 @@ async function loadPropertiesFromApi(logger, repositoryNwo) {
`Retrieved ${remoteProperties.length} repository properties: ${remoteProperties.map((p) => p.property_name).join(", ")}`
);
const properties = {};
const unrecognisedProperties = [];
for (const property of remoteProperties) {
if (property.property_name === void 0) {
throw new Error(
@@ -104337,6 +104339,8 @@ async function loadPropertiesFromApi(logger, repositoryNwo) {
}
if (isKnownPropertyName(property.property_name)) {
setProperty2(properties, property.property_name, property.value, logger);
} else if (property.property_name.startsWith(GITHUB_CODEQL_PROPERTY_PREFIX) && !isDynamicWorkflow()) {
unrecognisedProperties.push(property.property_name);
}
}
if (Object.keys(properties).length === 0) {
@@ -104351,6 +104355,12 @@ async function loadPropertiesFromApi(logger, repositoryNwo) {
logger.debug(` ${property}: ${value}`);
}
}
if (unrecognisedProperties.length > 0) {
const unrecognisedPropertyList = unrecognisedProperties.map((name) => `'${name}'`).join(", ");
logger.warning(
`Found repository properties (${unrecognisedPropertyList}), which look like CodeQL Action repository properties, but which are not understood by this version of the CodeQL Action. Do you need to update to a newer version?`
);
}
return properties;
} catch (e) {
throw new Error(