@@ -15,6 +15,7 @@ public override void Setup(T context, ISetupContext info)
1515
1616 context . IsPullRequest = buildSystem . IsPullRequest ;
1717 context . BranchName = context . GetBranchName ( ) ;
18+ context . RepositoryName = context . GetRepositoryName ( ) ;
1819 context . IsOriginalRepo = context . IsOriginalRepo ( ) ;
1920 context . IsMainBranch = context . IsMainBranch ( ) ;
2021 context . IsSupportBranch = context . IsSupportBranch ( ) ;
@@ -48,12 +49,7 @@ public override void Teardown(T context, ITeardownContext info)
4849 {
4950 context . Information ( "Starting Teardown..." ) ;
5051
51- context . Information ( "Pull Request: {0}" , context . IsPullRequest ) ;
52- context . Information ( "Original Repo: {0}" , context . IsOriginalRepo ) ;
53- context . Information ( "Branch Name: {0}" , context . BranchName ) ;
54- context . Information ( "Main Branch: {0}" , context . IsMainBranch ) ;
55- context . Information ( "Support Branch: {0}" , context . IsSupportBranch ) ;
56- context . Information ( "Tagged: {0}" , context . IsTagged ) ;
52+ LogBuildInformation ( context ) ;
5753
5854 context . Information ( "Finished running tasks." ) ;
5955 }
@@ -67,16 +63,23 @@ protected void LogBuildInformation(T context)
6763 {
6864 if ( context . HasArgument ( Arguments . Target ) )
6965 {
70- context . Information ( "Target: {0}" , context . Argument < string > ( Arguments . Target ) ) ;
66+ context . Information ( $ "Target: { context . Argument < string > ( Arguments . Target ) } " ) ;
7167 }
72- context . Information ( "Version: {0}" , context . Version ? . SemVersion ) ;
73- context . Information ( "Build Agent: {0}" , context . GetBuildAgent ( ) ) ;
74- context . Information ( "OS: {0}" , context . GetOS ( ) ) ;
75- context . Information ( "Pull Request: {0}" , context . IsPullRequest ) ;
76- context . Information ( "Original Repo: {0}" , context . IsOriginalRepo ) ;
77- context . Information ( "Branch Name: {0}" , context . BranchName ) ;
78- context . Information ( "Main Branch: {0}" , context . IsMainBranch ) ;
79- context . Information ( "Support Branch: {0}" , context . IsSupportBranch ) ;
80- context . Information ( "Tagged: {0}" , context . IsTagged ) ;
68+ if ( context . Version is not null )
69+ {
70+ context . Information ( $ "Version: { context . Version . SemVersion } ") ;
71+ }
72+ context . Information ( $ "Build Agent: { context . GetBuildAgent ( ) } ") ;
73+ context . Information ( $ "OS: { context . GetOS ( ) } ") ;
74+ context . Information ( $ "Pull Request: { context . IsPullRequest } ") ;
75+ context . Information ( $ "Repository Name: { context . RepositoryName } ") ;
76+ context . Information ( $ "Original Repository: { context . IsOriginalRepo } ") ;
77+ context . Information ( $ "Branch Name: { context . BranchName } ") ;
78+ context . Information ( $ "Main Branch: { context . IsMainBranch } ") ;
79+ context . Information ( $ "Support Branch: { context . IsSupportBranch } ") ;
80+ context . Information ( $ "Tagged: { context . IsTagged } ") ;
81+ context . Information ( $ "IsStableRelease: { context . IsStableRelease } ") ;
82+ context . Information ( $ "IsTaggedPreRelease: { context . IsTaggedPreRelease } ") ;
83+ context . Information ( $ "IsInternalPreRelease: { context . IsInternalPreRelease } ") ;
8184 }
8285}
0 commit comments