Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Only emit one message with accumulated property names
  • Loading branch information
mbg committed Mar 13, 2026
commit b4937c19e53d395cc647fe16c4e00788a4e7ded3
11 changes: 8 additions & 3 deletions lib/init-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/feature-flags/properties.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ test.serial(
warningSpy.firstCall.args[0]
.toString()
.startsWith(
`Found a repository property named '${propertyName}', which looks like a CodeQL Action repository property`,
`Found repository properties ('${propertyName}'), which look like CodeQL Action repository properties`,
),
);
},
Expand Down
23 changes: 17 additions & 6 deletions src/feature-flags/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ export async function loadPropertiesFromApi(
);

const properties: RepositoryProperties = {};
const unrecognisedProperties: string[] = [];

for (const property of remoteProperties) {
if (property.property_name === undefined) {
throw new Error(
Expand All @@ -131,12 +133,7 @@ export async function loadPropertiesFromApi(
property.property_name.startsWith(GITHUB_CODEQL_PROPERTY_PREFIX) &&
!isDynamicWorkflow()
) {
Comment thread
mbg marked this conversation as resolved.
Comment thread
mbg marked this conversation as resolved.
logger.warning(
`Found a repository property named '${property.property_name}', ` +
"which looks like a CodeQL Action repository property, " +
"but which is not understood by this version of the CodeQL Action. " +
"Do you need to update to a newer version?",
);
unrecognisedProperties.push(property.property_name);
}
}

Expand All @@ -153,6 +150,20 @@ export async function loadPropertiesFromApi(
}
}

// Emit a warning if we encountered unrecognised properties that have our prefix.
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(
Expand Down
Loading