@@ -182,16 +182,19 @@ private async Task DownloadLatestRunner(CancellationToken token)
182
182
183
183
try
184
184
{
185
- #if DEBUG
186
185
// Much of the update process (targetVersion, archive) is server-side, this is a way to control it from here for testing specific update scenarios
187
186
// Add files like 'runner_v2.281.2.tar.gz' or 'runner_v2.283.0.zip' depending on your platform in your runner root folder
188
187
// Note that runners still need to be behind the server's runner version in order to receive an 'AgentRefreshMessage' and trigger this update
189
188
// This should not be in the release build to prevent tampering with updates
190
189
var isMockUpdate = StringUtil . ConvertToBoolean ( Environment . GetEnvironmentVariable ( "GITHUB_ACTIONS_RUNNER_IS_MOCK_UPDATE" ) ) ;
190
+
191
+ _terminal . WriteLine ( isMockUpdate . ToString ( ) ) ;
191
192
if ( isMockUpdate )
192
193
{
193
194
// the env var should be of format GITHUB_ACTIONS_RUNNER_MOCK_VERSION_LIST='v2.281.2,v2.283.0,v2.283.1,v2.284.0'
194
195
var mockVersions = Environment . GetEnvironmentVariable ( "GITHUB_ACTIONS_RUNNER_MOCK_VERSION_LIST" ) . Split ( ',' ) ;
196
+
197
+ _terminal . WriteLine ( string . Join ( "," , mockVersions ) ) ;
195
198
if ( mockVersions . Any ( ) )
196
199
{
197
200
var targetVersion = mockVersions . First ( ) ;
@@ -205,12 +208,14 @@ private async Task DownloadLatestRunner(CancellationToken token)
205
208
archiveFile = Path . Combine ( HostContext . GetDirectory ( WellKnownDirectory . Root ) , $ "runner{ targetVersion } .tar.gz") ;
206
209
}
207
210
211
+ _terminal . WriteLine ( $ "Mock target version is: { targetVersion } ") ;
212
+
208
213
var newMockVersions = string . Join ( "," , mockVersions . Skip ( 1 ) ) ;
209
214
Environment . SetEnvironmentVariable ( "GITHUB_ACTIONS_RUNNER_MOCK_VERSION_LIST" , newMockVersions ) ;
210
215
_updateTrace . Add ( $ "Mocking update with file: { archiveFile } , nothing is downloaded") ;
216
+ _terminal . WriteLine ( $ "Mocking update with file: { archiveFile } , nothing is downloaded") ;
211
217
}
212
218
}
213
- #endif
214
219
// archiveFile is not null only if we mocked it above
215
220
if ( archiveFile == null )
216
221
{
0 commit comments