What is the right approach to getting test run output file artifacts out of a failed flake build being run in the context of github actions?

Hey there, I’m trying to figure out how I can get test failure output (in the form of something I can feed to e.g. ctrf-io/github-test-reporter) from a failed flake build in the context of a github actions workflow (using cachix/install-nix-action). Are there common patterns for this?

I would like some approach that lets me somehow store/feed test output files in the case that the build fails. However the only way I know how to produce file output in a nix flake is via outputs. Is there some nasty side-effecty way I can store build artifacts in a derivation that fails to build so I can have my cake and eat it too? Or am I thinking about this entirely the wrong way?

Thanks for any suggestions or feedback!