feat: Add UploadReleaseAssetFromRelease convenience helper by rockygeekz · Pull Request #3851 · google/go-github
changed the title
repos: add UploadReleaseAssetFromRelease convenience helper
feat: Add UploadReleaseAssetFromRelease convenience helper
…bsolute upload URLs This adds a convenience helper that uploads a release asset using the UploadURL returned in RepositoryRelease. Changes included: - Accept io.Reader + size instead of *os.File (consistent with NewUploadRequest) - Strip only the URI-template portion - Preserve absolute upload URLs exactly as provided (no path rewriting) - Add comprehensive tests for all branches (nil release, nil reader, negative size, absolute URLs, media type override, bad options, and upload success cases) This behavior ensures correct handling of GitHub Enterprise upload endpoints and aligns with the intent described in google#3849. Fixes google#3849.
- Preserve absolute upload URLs exactly as returned by the API - Trim only the URI-template portion - Align media-type resolution with UploadReleaseAsset - Update tests to cover all branches and BaseURL-prefixed paths - Improve error coverage using existing test helpers
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