Skip to content

Commit 5ab0b9a

Browse files
committed
Add more logging to the cron job. The raw GH download isn't parsed to JSON automatically (lack of content type headers?).
1 parent 9c8211f commit 5ab0b9a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/00_cron.yaml

+6-3
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@ jobs:
1616
const repoStatus = await github.request('GET https://raw.githubusercontent.com/LMS-Community/lms-server-repository/refs/heads/master/servers.json');
1717
1818
if (repoStatus.status !== 200) {
19+
console.error("Fetching repo file failed?" + JSON.stringify(repoStatus, null, 2));
1920
return false;
2021
}
2122
2223
// get the oldest timestamp for each version from previous builds
2324
const candidates = [];
24-
Object.keys(repoStatus.data).forEach(version => {
25+
const repoData = JSON.parse(repoStatus.data);
26+
27+
Object.keys(repoData).forEach(version => {
2528
const matches = version.match(/(\d+\.\d+)\.\d+/);
2629
if (matches && matches.length == 2) {
27-
const versionBuilds = repoStatus.data[version];
30+
const versionBuilds = repoData[version];
2831
candidates.push({
2932
v: matches[1],
3033
r: Object.keys(versionBuilds).reduce((accumulator, build) => {
@@ -35,7 +38,7 @@ jobs:
3538
})
3639
}
3740
else {
38-
delete repoStatus.data[version];
41+
delete repoData[version];
3942
}
4043
});
4144

0 commit comments

Comments
 (0)