@@ -37,15 +37,29 @@ if (!CIRCLE_TOKEN) exit('CIRCLECI_TOKEN missing');
3737if ( ! HAS_APP_CREDS && ! GH_TOKEN ) exit ( 'Missing GitHub auth: set GH_PR_COMMENT_TOKEN or APP_ID/INSTALLATION_ID/APP_PRIVATE_KEY' ) ;
3838if ( ! SLUG || ! JOB_NUM ) exit ( 'Missing CircleCI env (slug or job number)' ) ;
3939
40- const summaryPath = path . join ( OUTDIR , 'summary.json' ) ;
40+ const summaryPath = path . join ( OUTDIR , 'summary.json' ) ;
4141if ( ! fs . existsSync ( summaryPath ) ) {
4242 log ( 'summary.json not found; no failures or generator did not run. Skipping.' ) ;
4343 process . exit ( 0 ) ;
4444}
4545
46+ function formatRunTime ( ) {
47+ const now = new Date ( ) ;
48+ return now . toLocaleString ( 'en-US' , {
49+ weekday : 'short' ,
50+ year : 'numeric' ,
51+ month : 'short' ,
52+ day : 'numeric' ,
53+ hour : '2-digit' ,
54+ minute : '2-digit' ,
55+ timeZoneName : 'short'
56+ } ) ;
57+ }
58+
4659( async ( ) => {
4760 const summary = JSON . parse ( fs . readFileSync ( summaryPath , 'utf8' ) ) ;
4861 const failures = Array . isArray ( summary . failures ) ? summary . failures : [ ] ;
62+ const runTime = formatRunTime ( ) ;
4963
5064 const { owner, repo } = parseSlug ( SLUG ) ;
5165 const prNumber = await resolvePrNumber ( owner , repo , PR_URLS , SHA ) ;
@@ -65,6 +79,8 @@ if (!fs.existsSync(summaryPath)) {
6579 MARKER ,
6680 `✅ E2E tests passed (workflow: ${ escapeMd ( summary . workflowName || '' ) } )` ,
6781 '' ,
82+ `_Last run: ${ runTime } _` ,
83+ '' ,
6884 '_All tests are now passing! Previous failures have been resolved._'
6985 ] . join ( '\n' ) ;
7086 await gh ( `PATCH /repos/${ owner } /${ repo } /issues/comments/${ mine . id } ` , { body : successBody } ) ;
@@ -98,6 +114,8 @@ if (!fs.existsSync(summaryPath)) {
98114 MARKER ,
99115 `❌ E2E failures detected (workflow: ${ escapeMd ( summary . workflowName || '' ) } )` ,
100116 '' ,
117+ `_Last run: ${ runTime } _` ,
118+ '' ,
101119 `[View HTML report](${ indexUrl } )` ,
102120 '' ,
103121 `Top failing tests (${ top . length } /${ failures . length } ):` ,
0 commit comments