File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 1- using GitHub . Runner . Sdk ;
2- using System ;
1+ using System ;
32using System . IO ;
43using System . Linq ;
54using System . Runtime . Serialization ;
65using System . Text ;
76using System . Threading ;
7+ using GitHub . Runner . Sdk ;
88
99namespace GitHub . Runner . Common
1010{
@@ -64,8 +64,20 @@ public bool IsHostedServer
6464 {
6565 get
6666 {
67- // Old runners do not have this property. Hosted runners likely don't have this property either.
68- return _isHostedServer ?? true ;
67+ // If the value has been explicitly set, return it.
68+ if ( _isHostedServer . HasValue )
69+ {
70+ return _isHostedServer . Value ;
71+ }
72+
73+ // Otherwise, try to infer it from the GitHubUrl.
74+ if ( ! string . IsNullOrEmpty ( GitHubUrl ) )
75+ {
76+ return UrlUtil . IsHostedServer ( new UriBuilder ( GitHubUrl ) ) ;
77+ }
78+
79+ // Default to true since Hosted runners likely don't have this property set.
80+ return true ;
6981 }
7082
7183 set
You can’t perform that action at this time.
0 commit comments