How to make a github workflow error message show up in log and annotations?

Viewed 1575

I have a workflow step that runs this last stage of a shell command in a loop:

|| echo "::error Filename $filename doesn't match possible files" && exit 1 ; done

The exit is triggered appropriately, but the only annotation I see is:

Error: Process completed with exit code 1.

The log shows the entire shell command pipeline and also that same error message, but not my echo'd error.

How do I get my output, including the $filename variable, included?

1 Answers
Related