mirror of
https://github.com/actions/runner.git
synced 2026-01-23 21:11:34 +08:00
Add step command refinements: --here, --id, and help commands
- Add --here position option to insert steps before the current step - Add --id option to specify custom step IDs for expression references - Add --help flag support for all step commands with detailed usage info - Update browser extension UI with ID field and improved position dropdown
This commit is contained in:
@@ -18,6 +18,7 @@ namespace GitHub.Runner.Worker.Dap.StepCommands
|
||||
/// Creates a new run step (script step).
|
||||
/// </summary>
|
||||
/// <param name="script">The script to execute</param>
|
||||
/// <param name="id">Optional step ID for referencing in expressions (e.g., steps.<id>.outputs)</param>
|
||||
/// <param name="name">Optional display name for the step</param>
|
||||
/// <param name="shell">Optional shell (bash, sh, pwsh, python, etc.)</param>
|
||||
/// <param name="workingDirectory">Optional working directory</param>
|
||||
@@ -28,6 +29,7 @@ namespace GitHub.Runner.Worker.Dap.StepCommands
|
||||
/// <returns>A configured ActionStep with ScriptReference</returns>
|
||||
ActionStep CreateRunStep(
|
||||
string script,
|
||||
string id = null,
|
||||
string name = null,
|
||||
string shell = null,
|
||||
string workingDirectory = null,
|
||||
@@ -40,6 +42,7 @@ namespace GitHub.Runner.Worker.Dap.StepCommands
|
||||
/// Creates a new uses step (action step).
|
||||
/// </summary>
|
||||
/// <param name="actionReference">The action reference (e.g., "actions/checkout@v4", "owner/repo@ref", "./local-action")</param>
|
||||
/// <param name="id">Optional step ID for referencing in expressions (e.g., steps.<id>.outputs)</param>
|
||||
/// <param name="name">Optional display name for the step</param>
|
||||
/// <param name="with">Optional input parameters for the action</param>
|
||||
/// <param name="env">Optional environment variables</param>
|
||||
@@ -49,6 +52,7 @@ namespace GitHub.Runner.Worker.Dap.StepCommands
|
||||
/// <returns>A configured ActionStep with RepositoryPathReference or ContainerRegistryReference</returns>
|
||||
ActionStep CreateUsesStep(
|
||||
string actionReference,
|
||||
string id = null,
|
||||
string name = null,
|
||||
Dictionary<string, string> with = null,
|
||||
Dictionary<string, string> env = null,
|
||||
@@ -132,6 +136,7 @@ namespace GitHub.Runner.Worker.Dap.StepCommands
|
||||
/// <inheritdoc/>
|
||||
public ActionStep CreateRunStep(
|
||||
string script,
|
||||
string id = null,
|
||||
string name = null,
|
||||
string shell = null,
|
||||
string workingDirectory = null,
|
||||
@@ -149,7 +154,7 @@ namespace GitHub.Runner.Worker.Dap.StepCommands
|
||||
var step = new ActionStep
|
||||
{
|
||||
Id = stepId,
|
||||
Name = $"_dynamic_{stepId:N}",
|
||||
Name = id ?? $"_dynamic_{stepId:N}",
|
||||
DisplayName = name ?? "Run script",
|
||||
Reference = new ScriptReference(),
|
||||
Condition = condition ?? "success()",
|
||||
@@ -183,6 +188,7 @@ namespace GitHub.Runner.Worker.Dap.StepCommands
|
||||
/// <inheritdoc/>
|
||||
public ActionStep CreateUsesStep(
|
||||
string actionReference,
|
||||
string id = null,
|
||||
string name = null,
|
||||
Dictionary<string, string> with = null,
|
||||
Dictionary<string, string> env = null,
|
||||
@@ -201,7 +207,7 @@ namespace GitHub.Runner.Worker.Dap.StepCommands
|
||||
var step = new ActionStep
|
||||
{
|
||||
Id = stepId,
|
||||
Name = $"_dynamic_{stepId:N}",
|
||||
Name = id ?? $"_dynamic_{stepId:N}",
|
||||
DisplayName = name ?? actionReference,
|
||||
Condition = condition ?? "success()",
|
||||
Enabled = true
|
||||
|
||||
Reference in New Issue
Block a user