Skip to content

Commit d63009f

Browse files
CopilotTingluoHuang
andcommitted
Add feature flag guard for ACTIONS_ORCHESTRATION_ID
- Add SetOrchestrationIdEnvForNodeActions feature flag constant - Wrap ACTIONS_ORCHESTRATION_ID env var setting with feature flag check - Follows same pattern as ACTIONS_CACHE_SERVICE_V2 Co-authored-by: TingluoHuang <[email protected]>
1 parent 5f1de15 commit d63009f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/Runner.Common/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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 SetOrchestrationIdEnvForNodeActions = "actions_set_orchestration_id_env_for_node_actions";
175176
}
176177

177178
// Node version migration related constants

src/Runner.Worker/Handlers/NodeScriptActionHandler.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,12 @@ public async Task RunAsync(ActionRunStage stage)
7777
Environment["ACTIONS_CACHE_SERVICE_V2"] = bool.TrueString;
7878
}
7979

80-
if (ExecutionContext.Global.Variables.TryGetValue(Constants.Variables.System.OrchestrationId, out var orchestrationId) && !string.IsNullOrEmpty(orchestrationId))
80+
if (ExecutionContext.Global.Variables.GetBoolean(Constants.Runner.Features.SetOrchestrationIdEnvForNodeActions) ?? false)
8181
{
82-
Environment["ACTIONS_ORCHESTRATION_ID"] = orchestrationId;
82+
if (ExecutionContext.Global.Variables.TryGetValue(Constants.Variables.System.OrchestrationId, out var orchestrationId) && !string.IsNullOrEmpty(orchestrationId))
83+
{
84+
Environment["ACTIONS_ORCHESTRATION_ID"] = orchestrationId;
85+
}
8386
}
8487

8588
// Resolve the target script.

0 commit comments

Comments
 (0)