From 7e7237f7fcaa2726a562fca9af7b8e7577279625 Mon Sep 17 00:00:00 2001 From: Aaron Sherber Date: Fri, 16 Feb 2024 07:45:23 -0500 Subject: [PATCH] Fail the build if a script doesn't parse --- .github/actions/get-metadata/dist/index.js | 1 + .github/actions/get-metadata/src/index.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/get-metadata/dist/index.js b/.github/actions/get-metadata/dist/index.js index 5fa2f519..f2e70a1d 100644 --- a/.github/actions/get-metadata/dist/index.js +++ b/.github/actions/get-metadata/dist/index.js @@ -28828,6 +28828,7 @@ sourceFiles.forEach((fileName) => { } else { console.log(`ERROR: ${fileName}`); + (0, core_1.setFailed)(`Error parsing metadata for ${fileName}`); } }); fs_extra_1.default.writeFileSync(outFile, JSON.stringify(allMetadata.sort((a, b) => a.name.localeCompare(b.name)))); diff --git a/.github/actions/get-metadata/src/index.ts b/.github/actions/get-metadata/src/index.ts index 23dafb02..c175fac9 100644 --- a/.github/actions/get-metadata/src/index.ts +++ b/.github/actions/get-metadata/src/index.ts @@ -1,6 +1,6 @@ import path from 'path' -import { getInput } from '@actions/core' +import { getInput, setFailed } from '@actions/core' import fs from 'fs-extra' import { parseMetadata } from './parse' @@ -21,6 +21,7 @@ sourceFiles.forEach((fileName: string) => { allMetadata.push(parsed) } else { console.log(`ERROR: ${fileName}`) + setFailed(`Error parsing metadata for ${fileName}`); } })