fix(ci): fail release upload step on any non-2xx GitHub API response#474
Merged
Conversation
The "Upload to GitHub release assets" step ran `curl --fail` under
`set +e`, then only treated exit code 22 as a failure
(`if [ $? = 22 ]`). When GitHub returned 422, curl actually exited with
56 ("Failure in receiving network data" - curl aborts the HTTP/2
transfer mid-stream when `--fail` trips), so the `= 22` check never
matched. With errexit disabled the loop finished and the step exited 0,
turning a rejected upload green.
Drop the exit-code guessing: run curl in an `if !` so any non-zero exit
(22, 56, network errors) triggers `exit 1`, and use `--fail-with-body`
so GitHub's error payload (the 422 detail) stays visible in the logs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Change-Id: Ia4cd0d86e9292735e26dffd2afacad1b6511ccd3
Contributor
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🟢 Required ReviewsWonderful, this rule succeeded.
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
🟢 🔎 ReviewsWonderful, this rule succeeded.
🟢 📕 PR descriptionWonderful, this rule succeeded.
|
There was a problem hiding this comment.
Pull request overview
Improves the release workflow’s reliability by ensuring the “Upload to GitHub release assets” step fails whenever the GitHub API upload request fails, instead of only failing for a specific curl exit code.
Changes:
- Enable strict shell execution (
set -euo pipefail) for the upload step. - Wrap
curlinif ! ...; thenso any non-zero exit code fails the job. - Switch to
--fail-with-bodyso GitHub’s error payload (e.g., 422 details) remains visible in logs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JulianMaurin
approved these changes
May 20, 2026
kozlek
approved these changes
May 21, 2026
Contributor
Merge Queue Status
This pull request spent 2 minutes 44 seconds in the queue, including 2 minutes 7 seconds running CI. Required conditions to merge
|
34 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The "Upload to GitHub release assets" step ran
curl --failunderset +e, then only treated exit code 22 as a failure(
if [ $? = 22 ]). When GitHub returned 422, curl actually exited with56 ("Failure in receiving network data" - curl aborts the HTTP/2
transfer mid-stream when
--failtrips), so the= 22check nevermatched. With errexit disabled the loop finished and the step exited 0,
turning a rejected upload green.
Drop the exit-code guessing: run curl in an
if !so any non-zero exit(22, 56, network errors) triggers
exit 1, and use--fail-with-bodyso GitHub's error payload (the 422 detail) stays visible in the logs.
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com