Report errors by setting raw_output when it's error level (#645)

This solves #643 by setting the "raw_output" entry attribute when the log level is error.  This results in the log line being shipped to the Gitea UI.

Reviewed-on: https://gitea.com/gitea/act_runner/pulls/645
Reviewed-by: Zettat123 <zettat123@noreply.gitea.com>
Co-authored-by: Pablo Carranza <pcarranza@gmail.com>
Co-committed-by: Pablo Carranza <pcarranza@gmail.com>
This commit is contained in:
Pablo Carranza
2025-06-05 17:53:13 +00:00
committed by Lunny Xiao
parent 5302c25feb
commit 6a9a447f86
2 changed files with 39 additions and 26 deletions

View File

@ -143,6 +143,12 @@ func (r *Reporter) Fire(entry *log.Entry) error {
if step.StartedAt == nil {
step.StartedAt = timestamppb.New(timestamp)
}
// Force reporting log errors as raw output to prevent silent failures
if entry.Level == log.ErrorLevel {
entry.Data["raw_output"] = true
}
if v, ok := entry.Data["raw_output"]; ok {
if rawOutput, ok := v.(bool); ok && rawOutput {
if row := r.parseLogRow(entry); row != nil {