fix: support ##[command] log prefix in action run UI (#37882)

The Actions log parser only recognized `[command]`, so runner command
output emitted as `##[command] ...` was not shown in expanded step logs.

Add `##[command]` support to `LogLinePrefixCommandMap` in
`web_src/js/components/ActionRunView.ts` and cover it with a regression
test in `web_src/js/components/ActionRunView.test.ts`.

Changes
- Fixes Actions UI log rendering for runner command output
- Adds support for ##[command] in the Actions log parser
- Ensures runner echo ... lines are rendered when expanding step logs
- Includes a regression test covering ##[command] foo parsing

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Sumit
2026-05-28 10:52:26 +05:30
committed by GitHub
parent 3c73da51b9
commit 9e0e9e45ac
2 changed files with 2 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ test('LogLineMessage', () => {
'::warning file=test.js,line=1::foo': '<span class="log-msg log-cmd-warning"><span class="log-msg-label">Warning:</span><span> foo</span></span>',
'::notice::foo': '<span class="log-msg log-cmd-notice"><span class="log-msg-label">Notice:</span><span> foo</span></span>',
'::debug::foo': '<span class="log-msg log-cmd-debug"><span class="log-msg-label">Debug:</span><span> foo</span></span>',
'##[command] foo': '<span class="log-msg log-cmd-command"> foo</span>',
'[command] foo': '<span class="log-msg log-cmd-command"> foo</span>',
// hidden is special, it is actually skipped before creating

View File

@@ -20,6 +20,7 @@ const LogLinePrefixCommandMap: Record<string, LogLineCommandName> = {
'##[warning]': 'warning',
'##[notice]': 'notice',
'##[debug]': 'debug',
'##[command]': 'command',
'[command]': 'command',
// https://github.com/actions/toolkit/blob/master/docs/commands.md