Skip to content

Commit

Permalink
Fail the build if a script doesn't parse
Browse files Browse the repository at this point in the history
  • Loading branch information
asherber committed Feb 16, 2024
1 parent 6c0e8fd commit 7e7237f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/actions/get-metadata/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))));
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/get-metadata/src/index.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -21,6 +21,7 @@ sourceFiles.forEach((fileName: string) => {
allMetadata.push(parsed)
} else {
console.log(`ERROR: ${fileName}`)
setFailed(`Error parsing metadata for ${fileName}`);
}
})

Expand Down

0 comments on commit 7e7237f

Please sign in to comment.