@@ -495,7 +495,7 @@ const main = () => {
495495 if ( prIsOpen ( sourceRepo , args . prNumber , ghEnv ) ) {
496496 prContext = { repo : sourceRepo , prNumber : args . prNumber } ;
497497 } else {
498- console . log ( `[session-backup] Skipping PR comment: PR #${ args . prNumber } is not open`) ;
498+ log ( verbose , ` Skipping PR comment: PR #${ args . prNumber } is not open`) ;
499499 }
500500 } else if ( args . postComment ) {
501501 prContext = findPrContext ( repoCandidates , branch , verbose , ghEnv ) ;
@@ -586,13 +586,15 @@ const main = () => {
586586 } ,
587587 ] ;
588588 if ( args . dryRun ) {
589- console . log ( `[dry-run] Would upload snapshot to ${ backupRepo . fullName } :${ snapshotRef } ` ) ;
590- console . log ( `[dry-run] Would write ${ uploadEntries . length + 1 } file(s) including README and manifest.` ) ;
591- console . log ( `[dry-run] README URL: ${ readmeUrl } ` ) ;
592- console . log ( `[dry-run] Manifest URL: ${ manifestUrl } ` ) ;
589+ console . log (
590+ `[session-backup] dry-run: ${ source . commitSha . slice ( 0 , 12 ) } (${ summary . fileCount } files, ${ formatBytes ( summary . totalBytes ) } )`
591+ ) ;
592+ log ( verbose , `[dry-run] Upload target: ${ backupRepo . fullName } :${ snapshotRef } ` ) ;
593+ log ( verbose , `[dry-run] README URL: ${ readmeUrl } ` ) ;
594+ log ( verbose , `[dry-run] Manifest URL: ${ manifestUrl } ` ) ;
593595 if ( args . postComment && prContext !== null ) {
594- console . log ( `[dry-run] Would post comment to PR #${ prContext . prNumber } in ${ prContext . repo } :`) ;
595- console . log ( buildCommentBody ( { backupRepo , source, manifestUrl, readmeUrl, summary } ) ) ;
596+ log ( verbose , ` Would post comment to PR #${ prContext . prNumber } in ${ prContext . repo } :`) ;
597+ log ( verbose , buildCommentBody ( { source, manifestUrl, readmeUrl, summary } ) ) ;
596598 }
597599 return ;
598600 }
@@ -606,9 +608,11 @@ const main = () => {
606608 ghEnv
607609 ) ;
608610
609- console . log ( `[session-backup] Uploaded snapshot to ${ backupRepo . fullName } ` ) ;
610- console . log ( `[session-backup] README: ${ readmeUrl } ` ) ;
611- console . log ( `[session-backup] Manifest: ${ uploadResult . manifestUrl } ` ) ;
611+ console . log (
612+ `[session-backup] ok: ${ source . commitSha . slice ( 0 , 12 ) } (${ summary . fileCount } files, ${ formatBytes ( summary . totalBytes ) } )`
613+ ) ;
614+ log ( verbose , `[session-backup] Uploaded snapshot to ${ backupRepo . fullName } :${ snapshotRef } ` ) ;
615+ log ( verbose , `[session-backup] Manifest: ${ uploadResult . manifestUrl } ` ) ;
612616
613617 if ( args . postComment && prContext !== null ) {
614618 const comment = buildCommentBody ( {
@@ -620,8 +624,6 @@ const main = () => {
620624 } ) ;
621625 postPrComment ( prContext . repo , prContext . prNumber , comment , verbose , ghEnv ) ;
622626 }
623-
624- console . log ( "[session-backup] Session backup complete" ) ;
625627 } finally {
626628 fs . rmSync ( tmpDir , { recursive : true , force : true } ) ;
627629 }
0 commit comments