mirror of
https://github.com/actions/runner.git
synced 2026-01-16 00:35:13 +08:00
Fix expression parsing (partially)
This commit is contained in:
@@ -510,11 +510,20 @@ namespace GitHub.Runner.Worker.Dap
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Check if this is a REPL/shell command (context: "repl") or starts with shell prefix
|
// GitHub Actions expressions start with "${{" - always evaluate as expressions
|
||||||
if (evalContext == "repl" || expression.StartsWith("!") || expression.StartsWith("$"))
|
if (expression.StartsWith("${{"))
|
||||||
|
{
|
||||||
|
var result = EvaluateExpression(expression, executionContext);
|
||||||
|
return CreateSuccessResponse(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if this is a REPL/shell command:
|
||||||
|
// - context is "repl" (from Debug Console pane)
|
||||||
|
// - expression starts with "!" (explicit shell prefix for Watch pane)
|
||||||
|
if (evalContext == "repl" || expression.StartsWith("!"))
|
||||||
{
|
{
|
||||||
// Shell execution mode
|
// Shell execution mode
|
||||||
var command = expression.TrimStart('!', '$').Trim();
|
var command = expression.TrimStart('!').Trim();
|
||||||
if (string.IsNullOrEmpty(command))
|
if (string.IsNullOrEmpty(command))
|
||||||
{
|
{
|
||||||
return CreateSuccessResponse(new EvaluateResponseBody
|
return CreateSuccessResponse(new EvaluateResponseBody
|
||||||
@@ -530,7 +539,7 @@ namespace GitHub.Runner.Worker.Dap
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Expression evaluation mode
|
// Expression evaluation mode (Watch pane, hover, etc.)
|
||||||
var result = EvaluateExpression(expression, executionContext);
|
var result = EvaluateExpression(expression, executionContext);
|
||||||
return CreateSuccessResponse(result);
|
return CreateSuccessResponse(result);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user