@@ -258,7 +258,11 @@ const createIssues = async (octokit, context, maxOpenedIssues, labels, users, co
258
258
for ( let i = 0 ; i < numOfIssuesToCreate ; i ++ ) {
259
259
const slug = componentsCandidatesToCreateIssue [ i ] ;
260
260
const issueTitle = erroredComponents . includes ( slug ) ? `Failure Detected in \`${ slug } \`` : `Drift Detected in \`${ slug } \`` ;
261
- const file_name = slug . replace ( "/" , "_" )
261
+ const file_name = slug . replace ( / \/ / g, "_" )
262
+ if ( ! fs . existsSync ( `issue-description-${ file_name } .md` ) ) {
263
+ core . error ( `Failed to create issue for component ${ slug } because file "issue-description-${ file_name } .md" does not exist` ) ;
264
+ continue ;
265
+ }
262
266
const issueDescription = fs . readFileSync ( `issue-description-${ file_name } .md` , 'utf8' ) ;
263
267
264
268
const label = erroredComponents . includes ( slug ) ? "error" : "drift"
@@ -299,7 +303,7 @@ const updateIssues = async (octokit, context, componentsToIssues, componentsToUp
299
303
300
304
for ( let i = 0 ; i < componentsToUpdateExistingIssue . length ; i ++ ) {
301
305
const slug = componentsToUpdateExistingIssue [ i ] ;
302
- const file_name = slug . replace ( "/" , "_" )
306
+ const file_name = slug . replace ( / \/ / g , "_" )
303
307
const issueDescription = fs . readFileSync ( `issue-description-${ file_name } .md` , 'utf8' ) ;
304
308
const issueNumber = componentsToIssues [ slug ] . number ;
305
309
@@ -390,7 +394,7 @@ const postStepSummaries = async (driftingComponents, erroredComponents) => {
390
394
const components = driftingComponents . concat ( erroredComponents )
391
395
for ( let i = 0 ; i < components . length ; i ++ ) {
392
396
const slug = components [ i ] ;
393
- const file_name = slug . replace ( "/" , "_" )
397
+ const file_name = slug . replace ( / \/ / g , "_" )
394
398
const file = `step-summary-${ file_name } .md` ;
395
399
const content = fs . readFileSync ( file , 'utf-8' ) ;
396
400
0 commit comments