File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 33 - push
44jobs :
55 specs :
6+ runs-on : ubuntu-latest
7+ steps :
8+ - uses : actions/checkout@v4
9+ - uses : actions/setup-node@v4
10+ with :
11+ node-version : latest
12+ cache : npm
13+ - run : npm ci
14+ - run : npm run lint
15+ - run : npm run build-all
16+
17+ specs-old :
618 runs-on : ubuntu-22.04
719 steps :
820 - uses : actions/checkout@v3
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ dotenv.config();
2323
2424const build = async ( filename ) => {
2525 const md = readFileSync ( filename , "utf-8" ) ;
26- const html = await remark ( )
26+ const file = await remark ( )
2727 . use ( remarkPresetLintMarkdownStyleGuide )
2828 . use ( remarkGfm )
2929 . use ( remarkHeadingId )
@@ -164,11 +164,13 @@ const build = async (filename) => {
164164 </style>
165165 </head>
166166 <body>
167- ${ html . toString ( ) }
167+ ${ file . toString ( ) }
168168 </body>
169169</html>` ) ;
170170
171- console . error ( reporter ( html ) ) ;
171+ console . error ( reporter ( file ) ) ;
172+
173+ return file . messages . length ;
172174} ;
173175
174176( async function ( ) {
@@ -177,9 +179,14 @@ const build = async (filename) => {
177179 console . error ( "WARNING: No files built. Usage: 'npm run build -- filename.md'" ) ;
178180 }
179181
182+ let messageCount = 0 ;
180183 for ( const filename of files ) {
181184 console . log ( `Building: ${ filename } ...` ) ;
182- await build ( filename ) ;
185+ messageCount += await build ( filename ) ;
183186 console . log ( "" ) ;
184187 }
188+
189+ if ( messageCount > 0 ) {
190+ process . exit ( 1 ) ;
191+ }
185192} ( ) ) ;
You can’t perform that action at this time.
0 commit comments