diff --git a/.github/workflows/pull_request_check.yml b/.github/workflows/pull_request_check.yml index e48ad45..efc2907 100644 --- a/.github/workflows/pull_request_check.yml +++ b/.github/workflows/pull_request_check.yml @@ -35,7 +35,9 @@ jobs: - name: Set failure key run: | + ls if [[ -f "layer_report.txt" || -f "missing_licenses.txt" ]]; then + echo "Found a report..." echo "VALIDATION_FAILED=true" >> $GITHUB_ENV else echo "VALIDATION_FAILED=false" >> $GITHUB_ENV diff --git a/scripts/generateLayerOverview.ts b/scripts/generateLayerOverview.ts index 0cbcfa3..8bcbafd 100644 --- a/scripts/generateLayerOverview.ts +++ b/scripts/generateLayerOverview.ts @@ -56,7 +56,7 @@ const linuxHints = [] function validateLayer(layerJson: LayerConfigJson, context?: string): string[] { let errorCount = []; if (layerJson["overpassTags"] !== undefined) { - errorCount.push("Layer "+ layerJson.id+ "still uses the old 'overpassTags'-format. Please use \"source\": {\"osmTags\": }' instead of \"overpassTags\": (note: this isn't your fault, the custom theme generator still spits out the old format)") + errorCount.push("Layer " + layerJson.id + "still uses the old 'overpassTags'-format. Please use \"source\": {\"osmTags\": }' instead of \"overpassTags\": (note: this isn't your fault, the custom theme generator still spits out the old format)") } try { const layer = new LayerConfig(layerJson, "test", true) @@ -65,7 +65,7 @@ function validateLayer(layerJson: LayerConfigJson, context?: string): string[] { for (const remoteImage of remoteImages) { errorCount.push("Found a remote image: " + remoteImage + " in layer " + layer.id + ", please download it.") const path = remoteImage.substring(remoteImage.lastIndexOf("/") + 1) - linuxHints.push("wget "+remoteImage) + linuxHints.push("wget " + remoteImage) linuxHints.push(`echo '{"path":"${path}", "license": "", "authors": [ "= 0) { + console.log("Writing report!") writeFileSync("layer_report.txt", errors) } - + if (process.argv.indexOf("--no-fail") < 0) { throw msg; } diff --git a/scripts/generateLicenseInfo.ts b/scripts/generateLicenseInfo.ts index 87ac0b9..05a00f7 100644 --- a/scripts/generateLicenseInfo.ts +++ b/scripts/generateLicenseInfo.ts @@ -202,7 +202,8 @@ if (missingLicenses.length > 0) { const msg = `There are ${missingLicenses.length} licenses missing.` console.error(msg) if (process.argv.indexOf("--report") >= 0) { - writeFileSync("missing_licenses.txt", missingLicenses.join("\n")) + console.log("Writing report!") + writeFileSync("missing_licenses.txt", missingLicenses.join("\n")) } if (process.argv.indexOf("--no-fail") < 0) { throw msg