Skip to content

Commit b8a932c

Browse files
author
gferraro
committed
fuzzy match
1 parent ffb0575 commit b8a932c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/aggregate-versions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const getFilesWithExtension = (path, ext) => {
2828
}
2929
const findKeyInObject = (obj, key) => {
3030
for (const [k, v] of Object.entries(obj)) {
31-
if (k === key) {
31+
if (k.match(key)) {
3232
return v;
3333
} else if (typeof v === 'object') {
3434
const deeper = findKeyInObject(v, key);
@@ -104,7 +104,7 @@ const latestCommitDate = async (branch) => {
104104
const data = fs.readFileSync(path, "utf8");
105105
try {
106106
const yamlData = yaml.parse(data);
107-
const versionInfo = findKeyInObject(yamlData, "cacophony.pkg_installed_from_github");
107+
const versionInfo = findKeyInObject(yamlData, "cacophony.pkg_installed_from_*");
108108
const name = versionInfo.find(item => item.hasOwnProperty("name")).name;
109109
const version = versionInfo.find(item => item.hasOwnProperty("version")).version;
110110
versionData[branch][model][name] = version;

0 commit comments

Comments
 (0)