Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading assets with a GitHub release fails in set_github_release #9922

Closed
provTheodoreNewell opened this issue Aug 1, 2017 · 5 comments · Fixed by #9923
Closed

Uploading assets with a GitHub release fails in set_github_release #9922

provTheodoreNewell opened this issue Aug 1, 2017 · 5 comments · Fixed by #9923

Comments

@provTheodoreNewell
Copy link
Contributor

New Issue Checklist

Issue Description

Using the set_github_release action in Fastlane 2.50.0 with a valid array of paths for the upload_assets and relying on the default value for git_url (https://api.github.com) fails during the upload step, printing the error:

Please provide server URL, eg: https://api.github.com

This seems to be a regression introduced with the new github_api action at #8971.

Proposed Solution

In github_api.rb::construct_url, valid combinations of parameters should be either:

  1. server_url in conjunction with path that can be joined to create a full url
    or
  2. url as the full url

I will prepare a pull request with this solution.

Fastlane Version

fastlane gems

Gem Version Update-Status
fastlane 2.50.0 ✅ Up-To-Date
provTheodoreNewell added a commit to provTheodoreNewell/fastlane that referenced this issue Aug 1, 2017
Properly validates that either a `server_url` and `path` are provided, or a full `url`.
This resolves Issue fastlane#9922.
@ohayon
Copy link
Contributor

ohayon commented Aug 1, 2017

Thanks for raising the issue @provTheodoreNewell ! We would be happy to review that PR ! 🚀

provTheodoreNewell added a commit to provTheodoreNewell/fastlane that referenced this issue Aug 1, 2017
KrauseFx pushed a commit that referenced this issue Aug 1, 2017
* Fix incorrect GitHub url parameter validation

Properly validates that either a `server_url` and `path` are provided, or a full `url`.
This resolves Issue #9922.

* Add tests to verify #9922
@JohnEstropia
Copy link

JohnEstropia commented Aug 4, 2017

We're still experiencing a problem with the new Github actions (Fastlane 2.50.1) and it seems to be related to content-types:

[16:56:03]: Creating release of <redacted> on tag "<redacted>" with name "<redacted>".
[16:56:03]: Will also upload assets ["<redacted>.ipa", "<redacted>.app.dSYM.zip"].
[16:56:04]: Successfully created release at tag "<redacted>" on GitHub
[16:56:04]: See release at "https://github.com/<redacted>/releases/tag/<redacted>"
[16:56:05]: Uploading <redacted>.ipa
[16:56:32]: GitHub responded with 400:{"message":"Invalid Content-Type: ''","request_id":"CC20:3C83:6E76CA:755512:59842897"}
+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
|                                                                         Lane Context                                                                          |
+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
| DEFAULT_PLATFORM              | ios                                                                                                                           |
| PLATFORM_NAME                 | ios                                                                                                                           |
| LANE_NAME                     | ios deploy                                                                                                                    |
| GIT_REPO_WAS_CLEAN_ON_START   | true                                                                                                                          |
| SIGH_PROFILE_PATH             | /Users/<redacted>.mobileprovision                                  |
| SIGH_PROFILE_PATHS            | ["/Users/<redacted>.mobileprovision"]                              |
| SIGH_UDID                     | 8298b6c0-643d-4052-816b-4f59c7787f4f                                                                                          |
| SIGH_UUID                     | 8298b6c0-643d-4052-816b-4f59c7787f4f                                                                                          |
| SIGH_PROFILE_TYPE             | app-store                                                                                                                     |
| IPA_OUTPUT_PATH               | /Users/<redacted>.ipa                                              |
| DSYM_OUTPUT_PATH              | /Users/<redacted>.app.dSYM.zip                                     |
| XCODEBUILD_ARCHIVE            | /Users/<redacted>.xcarchive          |
| VERSION_NUMBER                | <redacted>                                                                                                                        |
| BUILD_NUMBER                  | <redacted>                                                                                                                           |
| SET_GITHUB_RELEASE_HTML_LINK  | https://github.com/<redacted>/releases/tag/<redacted>                                              |
| SET_GITHUB_RELEASE_RELEASE_ID | 7281426                                                                                                                       |
| SET_GITHUB_RELEASE_JSON       | {"url"=>"https://api.github.com/repos/<redacted>/releases/7281426",                                                       |
|                               | "assets_url"=>"https://api.github.com/repos/<redacted>/releases/7281426/assets",                                          |
|                               | "upload_url"=>"https://uploads.github.com/repos/<redacted>/releases/7281426/assets{?name,label}",                         |
|                               | "html_url"=>"https://github.com/<redacted>/releases/tag/<redacted>", "id"=>7281426,                |
|                               | "tag_name"=>"<redacted>", "target_commitish"=>"develop", "name"=>"<redacted>",  |
|                               | "draft"=>false, "author"=>{"login"=>"JohnEstropia", "id"=>3029684,                                                            |
|                               | "avatar_url"=>"https://avatars0.githubusercontent.com/u/3029684?v=4", "gravatar_id"=>"",                                      |
|                               | "url"=>"https://api.github.com/users/JohnEstropia", "html_url"=>"https://github.com/JohnEstropia",                            |
|                               | "followers_url"=>"https://api.github.com/users/JohnEstropia/followers",                                                       |
|                               | "following_url"=>"https://api.github.com/users/JohnEstropia/following{/other_user}",                                          |
|                               | "gists_url"=>"https://api.github.com/users/JohnEstropia/gists{/gist_id}",                                                     |
|                               | "starred_url"=>"https://api.github.com/users/JohnEstropia/starred{/owner}{/repo}",                                            |
|                               | "subscriptions_url"=>"https://api.github.com/users/JohnEstropia/subscriptions",                                               |
|                               | "organizations_url"=>"https://api.github.com/users/JohnEstropia/orgs",                                                        |
|                               | "repos_url"=>"https://api.github.com/users/JohnEstropia/repos",                                                               |
|                               | "events_url"=>"https://api.github.com/users/JohnEstropia/events{/privacy}",                                                   |
|                               | "received_events_url"=>"https://api.github.com/users/JohnEstropia/received_events", "type"=>"User", "site_admin"=>false},     |
|                               | "prerelease"=>true, "created_at"=>"2017-08-03T10:43:24Z", "published_at"=>"2017-08-04T07:56:04Z", "assets"=>[],               |
|                               | "tarball_url"=>"https://api.github.com/repos/<redacted>/tarball/<redacted>",                       |
|                               | "zipball_url"=>"https://api.github.com/repos/<redacted>/zipball/<redacted>",                       |
|                               | "body"=>"<redacted>\n"}                                                                                           |
+-------------------------------+-------------------------------------------------------------------------------------------------------------------------------+
[16:56:33]: Failed to upload asset <redacted>.ipa to GitHub.

+------+-----------------------------------------+-------------+
|                       fastlane summary                       |
+------+-----------------------------------------+-------------+
| Step | Action                                  | Time (in s) |
+------+-----------------------------------------+-------------+
| 1    | default_platform                        | 0           |
| 2    | update_fastlane                         | 2           |
| 3    | reset_git_repo                          | 0           |
| 4    | ensure_git_status_clean                 | 0           |
| 5    | git_branch                              | 0           |
| 6    | git fetch origin                        | 3           |
| 7    | git_pull                                | 6           |
| 8    | git submodule update --init --recursive | 0           |
| 9    | update_fastlane                         | 0           |
| 10   | xcversion                               | 2           |
| 11   | sigh                                    | 7           |
| 12   | gym                                     | 926         |
| 13   | get_version_number                      | 3           |
| 14   | get_build_number                        | 0           |
| 💥   | set_github_release                      | 28          |
+------+-----------------------------------------+-------------+

[16:56:33]: fastlane finished with errors

[!] Failed to upload asset <redacted>.ipa to GitHub.

Edit

Forgot to mention, our set_github_release usage used to work just fine.

@mathroule
Copy link

I'm experiencing the same issue using Fastlane 2.50.1

@ganjarpanji
Copy link

ganjarpanji commented Aug 4, 2017

i got this error
GitHub responded with 400:{"message":"Invalid Content-Type: ''","request_id":"DDD5:1BAFB:D6BDB6:E7924C:59841FEC"}`

the actions doesnt provide content_type parameter

@provTheodoreNewell
Copy link
Contributor Author

provTheodoreNewell commented Aug 4, 2017 via email

dvdchr pushed a commit to dvdchr/fastlane that referenced this issue Sep 5, 2017
* Fix incorrect GitHub url parameter validation

Properly validates that either a `server_url` and `path` are provided, or a full `url`.
This resolves Issue fastlane#9922.

* Add tests to verify fastlane#9922
dvdchr pushed a commit to dvdchr/fastlane that referenced this issue Sep 5, 2017
@fastlane fastlane locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants