mirror of
https://gitea.com/gitea/act_runner.git
synced 2025-06-21 05:47:59 +02:00
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:

committed by
Lunny Xiao

parent
5302c25feb
commit
6a9a447f86
@ -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 {
|
||||
|
Reference in New Issue
Block a user