File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -108,9 +108,9 @@ actionsToolkit.run(
108
108
if ( inputs . call && inputs . call === 'check' && res . stdout . length > 0 ) {
109
109
// checks warnings are printed to stdout: https://github.com/docker/buildx/pull/2647
110
110
// take the first line with the message summaryzing the warnings
111
- err = Error ( res . stdout . split ( '\n' ) [ 0 ] ?. trim ( ) ) ;
111
+ err = new Error ( res . stdout . split ( '\n' ) [ 0 ] ?. trim ( ) ) ;
112
112
} else if ( res . stderr . length > 0 ) {
113
- err = Error ( `buildx failed with: ${ res . stderr . match ( / ( .* ) \s * $ / ) ?. [ 0 ] ?. trim ( ) ?? 'unknown error' } ` ) ;
113
+ err = new Error ( `buildx failed with: ${ res . stderr . match ( / ( .* ) \s * $ / ) ?. [ 0 ] ?. trim ( ) ?? 'unknown error' } ` ) ;
114
114
}
115
115
}
116
116
} ) ;
@@ -225,7 +225,11 @@ actionsToolkit.run(
225
225
}
226
226
if ( stateHelper . tmpDir . length > 0 ) {
227
227
await core . group ( `Removing temp folder ${ stateHelper . tmpDir } ` , async ( ) => {
228
- fs . rmSync ( stateHelper . tmpDir , { recursive : true } ) ;
228
+ try {
229
+ fs . rmSync ( stateHelper . tmpDir , { recursive : true } ) ;
230
+ } catch ( e ) {
231
+ core . warning ( `Failed to remove temp folder ${ stateHelper . tmpDir } ` ) ;
232
+ }
229
233
} ) ;
230
234
}
231
235
}
@@ -285,7 +289,7 @@ function buildRecordRetentionDays(): number | undefined {
285
289
if ( val ) {
286
290
const res = parseInt ( val ) ;
287
291
if ( isNaN ( res ) ) {
288
- throw Error ( `Invalid build record retention days: ${ val } ` ) ;
292
+ throw new Error ( `Invalid build record retention days: ${ val } ` ) ;
289
293
}
290
294
return res ;
291
295
}
You can’t perform that action at this time.
0 commit comments