mirror of
https://github.com/github/codeql-action
synced 2026-05-23 20:00:54 +03:00
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:
Generated
+10
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user