Reduce duplication in the logs when errors occur in CLI commands by henrymercer · Pull Request #1927 · github/codeql-action (original) (raw)
This PR reduces duplication in the logs when errors occur in CodeQL CLI invocations by taking the following strategy:
- Try to find fatal errors in the CLI output.
- If that fails, then rather than taking the whole stderr, just take the last line. Be explicit that we're taking the last line in the log message since it won't always be a good fit, and point customers to the full logs.
- Fix a particularly bad case where during
analyzewe printed the error twice along with the stack trace. This resulted in us outputting the stderr three times along with a confusing stack trace.