Repository navigation
Conversation
Contributor
|
Thanks for your pull request! Unfortunately, it doesn't meet the requirements for review:
Please update your PR to address the above. This PR will be automatically closed in 4 days if these requirements are not met. Full contribution requirements
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
MIME detection reports the symlink’s type instead of its target’s content, and the binary MIME test relies on host utilities and shell format rather than an isolated, deterministic setup.
2 open issues
What changed in this PR
This PR addresses #15088 by extending release asset MIME detection beyond filename extensions, aiming to identify unrecognized artifacts more accurately.
Changes:
- Preserve extension-based detection, then invoke
fileon non-Windows systems when no MIME type is found. - Pass asset paths into detection while retaining the
application/octet-streamfallback. - Update MIME tests with temporary data and platform-binary cases.
| File | Description |
|---|---|
pkg/cmd/release/shared/upload.go |
Adds path-aware MIME detection using the external file command. |
pkg/cmd/release/shared/upload_test.go |
Updates MIME detection tests and refactors retry-test branching. |
Review effort: Balanced
eighty4
force-pushed
the
asset-mime-types
branch
3 times, most recently
from
November 18, 2026 00:30
4b6fabe to
924e598
Compare
eighty4
force-pushed
the
asset-mime-types
branch
from
November 18, 2026 00:32
924e598 to
3e55df1
Compare
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.

Fixes #15088
Description
Currently, uploaded asset mime types are only resolved by the extensions of the assets. It would be valuable to have a consistent
gh release createexperience whether releasing tarballs or cross-platform binaries built by a Rust or Zig toolchain by uploading the artifacts with specific and detailed mime types for the uploaded artifacts.This change adds a check with the file command on darwin/linux systems. First an extension-based mime type would be quickly resolved without forking a process. If the mime type is unresolved and the process is on appropriate systems, release uploads will attempt to fork a
file -b --mime-typeprocess to get an accurate mime type.How did you test this change?
The change is tested with
run.Stubto include testing a call offile -b --mime-type.Key points
The gains from simplifying CICD pipelines from scripting boilerplate to a single succinct command is greatly worth the process forking. No consideration was put into parallelizing the asset prep before uploading.
Notes for reviewers
This is an impactful change for users -- who knows what is currently being uploaded as
application/octet-stream? I'm assuming that most asset uploads have an extension and if they do not they are probably binaries.Authorship and follow-up
Authored by the user account, @eighty4, that is submitting the PR. Review comments will be received and actioned on by the same human.