Add upload diagnostics and fail-on-error option#6
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves diagnostics for the code coverage upload step by surfacing upload parameters in a collapsed log group and reporting the HTTP status code (including differentiating 201 stored vs 200 accepted-but-not-stored) along with the response body to aid troubleshooting.
Changes:
- Log key upload parameters in a grouped section to keep workflow logs readable.
- Capture and report the HTTP status code and response body from the upload API call.
- Emit warnings/notices for non-201 outcomes to make “green but no report” scenarios easier to diagnose.
Show a summary per file
| File | Description |
|---|---|
| action.yml | Adds grouped parameter logging and expands upload handling to parse/report HTTP status and response body. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 2
90e0795 to
4681ec5
Compare
Surface the HTTP status code and response body in the action output so that users can distinguish between a true 201 (report stored) and a 200 (report silently rejected, e.g. commit not latest on branch). Parameters are logged in a collapsed group to avoid noise. Add a fail-on-error input (default: false) so that upload failures do not break existing workflows. Users who want strict behaviour can opt in. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4681ec5 to
6d6f740
Compare
Testing the fail-on-error behaviourFirst, against the current version of https://github.com/joshhale/code-coverage-test/actions/runs/26042852804/job/76558955955?pr=1
Same behaviour when When
https://github.com/joshhale/code-coverage-test/actions/runs/26043964721/job/76562969572?pr=1 Testing the loggingWe see the upload parameters in the log. On 200 we get a warning that no action was taken:
No warning on 201:
|
Strip carriage returns before splitting headers from body so that the blank-line separator is matched correctly on responses with CRLF line endings from gh api --include. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>






Summary
Improves diagnostic output for the code coverage upload action and adds a fail-on-error option to control workflow failure behavior.
Problem
When the upload API returns a non-201 response (e.g. HTTP 200 for "commit is not latest on branch", or 4xx errors), the action currently swallows the response and exits successfully. Users have no way to tell whether their upload was actually accepted or silently rejected.
Changes
Diagnostic output
fail-on-error input (default: false)
Backward compatibility
This is fully backward compatible. The default behavior is unchanged: the action still exits 0 on any response. The only visible difference is additional annotations in the workflow log.