Skip to content

Commit 07920e8

Browse files
committed
Fix using keys instead of values
Also add `logger.debug` call with keys from API response
1 parent 40262b1 commit 07920e8

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

lib/init-action.js

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/feature-flags/properties.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ export async function loadPropertiesFromApi(
5050
);
5151
}
5252

53-
const knownProperties = new Set(Object.keys(RepositoryPropertyName));
53+
logger.debug(
54+
`Retrieved ${remoteProperties.length} repository properties: ${remoteProperties.map((p) => p.property_name).join(", ")}`,
55+
);
56+
57+
const knownProperties = new Set(Object.values(RepositoryPropertyName));
5458
const properties: RepositoryProperties = {};
5559
for (const property of remoteProperties) {
5660
if (property.property_name === undefined) {
@@ -59,7 +63,9 @@ export async function loadPropertiesFromApi(
5963
);
6064
}
6165

62-
if (knownProperties.has(property.property_name)) {
66+
if (
67+
knownProperties.has(property.property_name as RepositoryPropertyName)
68+
) {
6369
properties[property.property_name] = property.value;
6470
}
6571
}

0 commit comments

Comments
 (0)