File tree Expand file tree Collapse file tree 4 files changed +25
-0
lines changed
Expand file tree Collapse file tree 4 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,7 @@ public static class Features
172172 public static readonly string SnapshotPreflightHostedRunnerCheck = "actions_snapshot_preflight_hosted_runner_check" ;
173173 public static readonly string SnapshotPreflightImageGenPoolCheck = "actions_snapshot_preflight_image_gen_pool_check" ;
174174 public static readonly string CompareWorkflowParser = "actions_runner_compare_workflow_parser" ;
175+ public static readonly string SetOrchestrationIdEnvForActions = "actions_set_orchestration_id_env_for_actions" ;
175176 }
176177
177178 // Node version migration related constants
Original file line number Diff line number Diff line change @@ -239,6 +239,14 @@ public async Task RunAsync(ActionRunStage stage)
239239 Environment [ "ACTIONS_RESULTS_URL" ] = resultsUrl ;
240240 }
241241
242+ if ( ExecutionContext . Global . Variables . GetBoolean ( Constants . Runner . Features . SetOrchestrationIdEnvForActions ) ?? false )
243+ {
244+ if ( ExecutionContext . Global . Variables . TryGetValue ( Constants . Variables . System . OrchestrationId , out var orchestrationId ) && ! string . IsNullOrEmpty ( orchestrationId ) )
245+ {
246+ Environment [ "ACTIONS_ORCHESTRATION_ID" ] = orchestrationId ;
247+ }
248+ }
249+
242250 foreach ( var variable in this . Environment )
243251 {
244252 container . ContainerEnvironmentVariables [ variable . Key ] = container . TranslateToContainerPath ( variable . Value ) ;
Original file line number Diff line number Diff line change @@ -77,6 +77,14 @@ public async Task RunAsync(ActionRunStage stage)
7777 Environment [ "ACTIONS_CACHE_SERVICE_V2" ] = bool . TrueString ;
7878 }
7979
80+ if ( ExecutionContext . Global . Variables . GetBoolean ( Constants . Runner . Features . SetOrchestrationIdEnvForActions ) ?? false )
81+ {
82+ if ( ExecutionContext . Global . Variables . TryGetValue ( Constants . Variables . System . OrchestrationId , out var orchestrationId ) && ! string . IsNullOrEmpty ( orchestrationId ) )
83+ {
84+ Environment [ "ACTIONS_ORCHESTRATION_ID" ] = orchestrationId ;
85+ }
86+ }
87+
8088 // Resolve the target script.
8189 string target = null ;
8290 if ( stage == ActionRunStage . Main )
Original file line number Diff line number Diff line change @@ -318,6 +318,14 @@ public async Task RunAsync(ActionRunStage stage)
318318 Environment [ "ACTIONS_ID_TOKEN_REQUEST_TOKEN" ] = systemConnection . Authorization . Parameters [ EndpointAuthorizationParameters . AccessToken ] ;
319319 }
320320
321+ if ( ExecutionContext . Global . Variables . GetBoolean ( Constants . Runner . Features . SetOrchestrationIdEnvForActions ) ?? false )
322+ {
323+ if ( ExecutionContext . Global . Variables . TryGetValue ( Constants . Variables . System . OrchestrationId , out var orchestrationId ) && ! string . IsNullOrEmpty ( orchestrationId ) )
324+ {
325+ Environment [ "ACTIONS_ORCHESTRATION_ID" ] = orchestrationId ;
326+ }
327+ }
328+
321329 ExecutionContext . Debug ( $ "{ fileName } { arguments } ") ;
322330
323331 Inputs . TryGetValue ( "standardInInput" , out var standardInInput ) ;
You can’t perform that action at this time.
0 commit comments