@@ -211,30 +211,29 @@ async function run(context: typeof github.context): Promise<void> {
211211 workflowFiles . push ( workflow ) ;
212212 if ( fs . existsSync ( workflow . filePath ) ) {
213213 console . log ( "\nReading:" + workflow . filePath ) ;
214- try {
215- let yaml : any = yamlParse . load (
216- fs . readFileSync ( workflow . filePath , "utf-8" ) ,
217- ) ;
218- let actionStrings = getPropertyValues ( yaml , "uses" ) ;
219-
220- actionStrings . forEach ( ( as ) => {
221- workflow . actions . push ( new Action ( as ) ) ;
222- } ) ;
223- } catch ( error : unknown ) {
224- if ( error instanceof Error ) {
225- core . debug ( error . message ) ;
226- core . setFailed (
227- `Unable to parse workflow file '${ workflow . filePath } ' - please ensure it's formatted properly.` ,
214+ try {
215+ let yaml : any = yamlParse . load (
216+ fs . readFileSync ( workflow . filePath , "utf-8" ) ,
228217 ) ;
229- } else {
230- // Handle cases where error is not an Error object
231- core . debug ( "An unknown error occurred." ) ;
232- core . setFailed ( "An unknown error occurred." ) ;
218+ let actionStrings = getPropertyValues ( yaml , "uses" ) ;
219+
220+ actionStrings . forEach ( ( as ) => {
221+ workflow . actions . push ( new Action ( as ) ) ;
222+ } ) ;
223+ } catch ( error : unknown ) {
224+ if ( error instanceof Error ) {
225+ core . debug ( error . message ) ;
226+ core . setFailed (
227+ `Unable to parse workflow file '${ workflow . filePath } ' - please ensure it's formatted properly.` ,
228+ ) ;
229+ } else {
230+ // Handle cases where error is not an Error object
231+ core . debug ( "An unknown error occurred." ) ;
232+ core . setFailed ( "An unknown error occurred." ) ;
233+ }
234+ console . log ( error ) ;
233235 }
234- console . log ( error ) ;
235- }
236- }
237-
236+ }
238237 } ) ;
239238
240239 //iterate through all the workflow files found
0 commit comments