Repository navigation
Pass --allow-escape-sequences when downloading release assets - #178
Merged
Merged
Conversation
gh 2.97.0 added a guard that refuses to write a response body containing terminal escape bytes. Firmware images are arbitrary binary, so whether a given one trips it is luck: this failed 4 of 9 matrix jobs in esphome/bluetooth-proxies and blocked the R2 upload and both promote jobs. Verified the flag returns the asset byte-identical to a direct download.
1 task done
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.
gh 2.97.0 added a security guard that refuses to write a response body containing terminal escape bytes, offering
--allow-escape-sequencesas the opt-out. Firmware images are arbitrary binary, so whether any given one contains such a byte sequence is luck. That made asset downloads fail nondeterministically: this bluetooth-proxies run lost 4 of 9 "Prepare artifact" jobs, which in turn blockedUpload to R2and both promote jobs, while the other 5 devices passed on identical code.Both sites that stream an asset body through
gh apinow pass the flag: the firmware download inpublish-firmware-to-r2.yml(the actual failure) and the manifest download inpublish-draft-release.yml. Manifests are JSON and rarely trip the guard, but a release body embedded in one could carry an escape byte, so it gets the same treatment.The asset listing calls still use plain
gh api. They return JSON that gh is happy to write, and--jqis convenient there.Verified against
gl-s10-esp32.factory.bin, one of the assets that actually failed: without the flaggh apiexits 1 having written 0 bytes; with it, it exits 0 and produces a file byte-identical (sha25606d1d08d…) to the same asset fetched over plain curl. So the flag suppresses the check outright rather than rewriting the payload, and binary passes through intact.One deployment note: the guard and the flag both shipped in gh 2.97.0, so any runner new enough to reject a download is new enough to accept the flag. The reverse is the only risk, since gh 2.96 would reject the flag as unknown.
actions/runner-imagesstill lists 2.96.0 in itsubuntu-latestREADME, but the failing run above clearly hit the 2.97 guard, so that README is lagging the rollout rather than describing it.Consumers pinning this workflow will need their pin bumped once this is released.