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:
Francesco Renzi
2026-01-22 10:36:56 +00:00
committed by GitHub
parent 8210dab8d4
commit 8fbe9aa963
9 changed files with 1396 additions and 10 deletions

View File

@@ -376,6 +376,19 @@ namespace GitHub.Runner.Common.Tests.Worker.Dap.StepCommands
Assert.Equal(3, addCmd.Position.Index);
}
[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Worker")]
public void Parse_AddRunCommand_PositionHere()
{
// Arrange & Act
var cmd = _parser.Parse("steps add run \"echo here\" --here");
// Assert
var addCmd = Assert.IsType<AddRunCommand>(cmd);
Assert.Equal(PositionType.Here, addCmd.Position.Type);
}
[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Worker")]
@@ -420,6 +433,20 @@ namespace GitHub.Runner.Common.Tests.Worker.Dap.StepCommands
Assert.Equal("npm", addCmd.With["cache"]);
}
[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Worker")]
public void Parse_AddUsesCommand_PositionHere()
{
// Arrange & Act
var cmd = _parser.Parse("steps add uses actions/checkout@v4 --here");
// Assert
var addCmd = Assert.IsType<AddUsesCommand>(cmd);
Assert.Equal("actions/checkout@v4", addCmd.Action);
Assert.Equal(PositionType.Here, addCmd.Position.Type);
}
[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Worker")]
@@ -596,6 +623,19 @@ namespace GitHub.Runner.Common.Tests.Worker.Dap.StepCommands
Assert.Equal(3, moveCmd.Position.Index);
}
[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Worker")]
public void Parse_MoveCommand_Here()
{
// Arrange & Act
var cmd = _parser.Parse("steps move 5 --here");
// Assert
var moveCmd = Assert.IsType<MoveCommand>(cmd);
Assert.Equal(PositionType.Here, moveCmd.Position.Type);
}
[Fact]
[Trait("Level", "L0")]
[Trait("Category", "Worker")]