File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed
Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change @@ -5,21 +5,26 @@ interface ChangesetsOutput {
55 version : string ;
66}
77
8- const bumpedPackages : string [ ] = [ ] ;
9-
10- const packages = ( ) => {
8+ function main ( ) : void {
119 try {
12- return JSON . parse ( core . getInput ( 'bumped-packages' , { required : true } ) ) as ChangesetsOutput [ ]
10+ const input = core . getInput ( 'bumped-packages' , { required : true } ) ;
11+ const packages = JSON . parse ( input ) as ChangesetsOutput [ ] ;
12+
13+ const bumpedPackages : string [ ] = [ ] ;
14+
15+ for ( const pkg of packages ) {
16+ bumpedPackages . push ( pkg . name ) ;
17+ }
18+
19+ const output = bumpedPackages . join ( ',' ) ;
20+ core . setOutput ( "parsed-packages" , output ) ;
21+
22+ core . info ( 'Parsed packages:\n\n- ' + bumpedPackages . join ( '\n- ' ) ) ;
23+
1324 } catch ( error ) {
14- core . setFailed ( error as Error )
15- process . exit ( 256 )
25+ core . setFailed ( `Failed to parse bumped packages: ${ error } ` ) ;
26+ process . exit ( 1 ) ;
1627 }
1728}
1829
19- for ( const pkg of packages ( ) ) {
20- bumpedPackages . push ( pkg . name )
21- }
22-
23- core . setOutput ( "parsed-packages" , bumpedPackages . join ( '\n' ) )
24-
25- core . info ( 'Written to output:\n\n- ' + bumpedPackages . join ( '\n- ' ) )
30+ main ( ) ;
You can’t perform that action at this time.
0 commit comments