Skip to content

Commit 38e74a5

Browse files
authored
Merge pull request #701 from asherber/get-metadata
Fail the build if a script doesn't parse
2 parents 6c0e8fd + 7e7237f commit 38e74a5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.github/actions/get-metadata/dist/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -28828,6 +28828,7 @@ sourceFiles.forEach((fileName) => {
2882828828
}
2882928829
else {
2883028830
console.log(`ERROR: ${fileName}`);
28831+
(0, core_1.setFailed)(`Error parsing metadata for ${fileName}`);
2883128832
}
2883228833
});
2883328834
fs_extra_1.default.writeFileSync(outFile, JSON.stringify(allMetadata.sort((a, b) => a.name.localeCompare(b.name))));

.github/actions/get-metadata/src/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from 'path'
22

3-
import { getInput } from '@actions/core'
3+
import { getInput, setFailed } from '@actions/core'
44
import fs from 'fs-extra'
55
import { parseMetadata } from './parse'
66

@@ -21,6 +21,7 @@ sourceFiles.forEach((fileName: string) => {
2121
allMetadata.push(parsed)
2222
} else {
2323
console.log(`ERROR: ${fileName}`)
24+
setFailed(`Error parsing metadata for ${fileName}`);
2425
}
2526
})
2627

0 commit comments

Comments
 (0)