I am working on an automated pull request check via GitHub actions and I want to preserve some data from a command's stderr output between jobs.
For this, I need to write the stderr to an artifact file, but before that I need to also remove some control chars from it via sed, otherwise I end up with something like:
\x1b[31mFound 344 errors!\x1b[39;49m
I then want the main command to return the same exit code in order to fail the check and prevent merging of the pull request.
I can probably take care of a subset of what needs doing, but am unable to take care of all 3 together together (sed > file write > stderr). If it makes it easier, I am okay with writing both stdout and stderr to the file as well.
Open to suggestions to do this differently.