{"action":"created","comment":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/55872333","id":55872333,"diff_hunk":"@@ -0,0 +1,125 @@\n+module Fastlane\n+  module Actions\n+    module SharedValues\n+      SENTRY_CUSTOM_VALUE = :SENTRY_CUSTOM_VALUE\n+    end\n+\n+    class SentryAction < Action\n+      def self.run(params)\n+        require 'rest-client'\n+\n+        # Params - API\n+        host = params[:api_host]\n+        api_key = params[:api_key]\n+        org = params[:org_slug]\n+        project = params[:project_slug]\n+\n+        # Params - dSYM\n+        dsym = params[:dsym_path]\n+        dsyms = params[:dsym_paths] || []\n+\n+        # Url to post dSYMs to\n+        url = \"#{host}/projects/#{org}/#{project}/files/dsyms/\"\n+        resource = RestClient::Resource.new( url, api_key, '' )\n+\n+        UI.message \"Will upload dSYM(s) to #{url}\"\n+\n+        # Upload dsym(s)\n+        dsym_paths = [dsym] + dsyms\n+        uploaded_paths = dsym_paths.compact.map do |dsym|\n+          upload_dsym(resource, dsym)\n+        end\n+\n+        # Return uplaoded dSYM paths\n+        uploaded_paths\n+      end\n+\n+      def self.upload_dsym(resource, dsym)\n+        begin\n+          UI.message \"Uploading... #{dsym}\"\n+          resource.post(file: File.new(dsym, 'rb')) unless  Helper.test?\n+          UI.success 'dSYM successfully uploaded to Sentry!'\n+\n+          dsym\n+        rescue\n+          UI.user_error! 'Error while trying to upload dSYM to Sentry'\n+        end\n+      end\n+\n+      #####################################################\n+      # @!group Documentation\n+      #####################################################\n+\n+      def self.description\n+        \"Upload dSYM symbolication files to Sentry\"\n+      end\n+\n+      def self.details\n+        [\n+          \"This action allows you to upload symbolication files to Sentry.\",\n+          \"It's extra useful if you use it to download the latest dSYM files from Apple when you\",\n+          \"use Bitcode\"\n+        ].join(\" \")\n+      end\n+\n+      def self.available_options\n+        [\n+          FastlaneCore::ConfigItem.new(key: :api_host,\n+                                       env_name: \"SENTRY_HOST\",\n+                                       description: \"API host url for Sentry\",\n+                                       is_string: true,\n+                                       default_value: \"https://app.getsentry.com/api/0\",\n+                                       optional: true\n+                                      ),\n+          FastlaneCore::ConfigItem.new(key: :api_key,\n+                                       env_name: \"SENTRY_API_KEY\",\n+                                       description: \"API Key for Sentry\",\n+                                       verify_block: proc do |value|\n+                                          raise \"No API token for SentryAction given, pass using `api_key: 'key'`\".red unless (value and not value.empty?)\n+                                       end),\n+          FastlaneCore::ConfigItem.new(key: :org_slug,\n+                                       env_name: \"SENTRY_ORG_SLUG\",\n+                                       description: \"Organization slug for Sentry project\",\n+                                       verify_block: proc do |value|\n+                                          raise \"No organization slug for SentryAction given, pass using `org_slug: 'org'`\".red unless (value and not value.empty?)\n+                                       end),\n+          FastlaneCore::ConfigItem.new(key: :project_slug,\n+                                       env_name: \"SENTRY_PROJECT_SLUG\",\n+                                       description: \"Prgoject slug for Sentry\",\n+                                       verify_block: proc do |value|\n+                                          raise \"No project slug for SentryAction given, pass using `project_slug: 'project'`\".red unless (value and not value.empty?)","path":"fastlane/lib/fastlane/actions/sentry.rb","position":90,"original_position":90,"commit_id":"2f0b7dfe5fe724ecd1559857d2fadb497abb9a72","original_commit_id":"2f0b7dfe5fe724ecd1559857d2fadb497abb9a72","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Use 2 (not 3) spaces for indentation.<br>Use `!` instead of `not`.<br>Don't use parentheses around the condition of an `unless`.","created_at":"2016-03-11T19:00:50Z","updated_at":"2016-03-11T19:00:50Z","html_url":"https://github.com/fastlane/fastlane/pull/3699#discussion_r55872333","pull_request_url":"https://api.github.com/repos/fastlane/fastlane/pulls/3699","_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/55872333"},"html":{"href":"https://github.com/fastlane/fastlane/pull/3699#discussion_r55872333"},"pull_request":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/3699"}}},"pull_request":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/3699","id":62586969,"html_url":"https://github.com/fastlane/fastlane/pull/3699","diff_url":"https://github.com/fastlane/fastlane/pull/3699.diff","patch_url":"https://github.com/fastlane/fastlane/pull/3699.patch","issue_url":"https://api.github.com/repos/fastlane/fastlane/issues/3699","number":3699,"state":"open","locked":false,"title":"Adding Sentry action for uploading dSYM files","user":{"login":"joshdholtz","id":401294,"avatar_url":"https://avatars.githubusercontent.com/u/401294?v=3","gravatar_id":"","url":"https://api.github.com/users/joshdholtz","html_url":"https://github.com/joshdholtz","followers_url":"https://api.github.com/users/joshdholtz/followers","following_url":"https://api.github.com/users/joshdholtz/following{/other_user}","gists_url":"https://api.github.com/users/joshdholtz/gists{/gist_id}","starred_url":"https://api.github.com/users/joshdholtz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshdholtz/subscriptions","organizations_url":"https://api.github.com/users/joshdholtz/orgs","repos_url":"https://api.github.com/users/joshdholtz/repos","events_url":"https://api.github.com/users/joshdholtz/events{/privacy}","received_events_url":"https://api.github.com/users/joshdholtz/received_events","type":"User","site_admin":false},"body":"New action, `sentry`, for uploading dSYM files to [Sentry](https://getsentry.com)'s API. Takes either (or both) a single dSYM file path or an array of file paths\r\n\r\nDefaults use...\r\n- `Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]` from Xcode output (`gym`, `ipa`, etc.)\r\n- `Actions.lane_context[SharedValues::DSYM_PATHS]` from ITC (`download_dsyms`)","created_at":"2016-03-11T19:00:47Z","updated_at":"2016-03-11T19:00:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09eeb0698f8bb608180946f36411d1c3b28d066a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fastlane/fastlane/pulls/3699/commits","review_comments_url":"https://api.github.com/repos/fastlane/fastlane/pulls/3699/comments","review_comment_url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastlane/fastlane/issues/3699/comments","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/2f0b7dfe5fe724ecd1559857d2fadb497abb9a72","head":{"label":"joshdholtz:sentry-action","ref":"sentry-action","sha":"2f0b7dfe5fe724ecd1559857d2fadb497abb9a72","user":{"login":"joshdholtz","id":401294,"avatar_url":"https://avatars.githubusercontent.com/u/401294?v=3","gravatar_id":"","url":"https://api.github.com/users/joshdholtz","html_url":"https://github.com/joshdholtz","followers_url":"https://api.github.com/users/joshdholtz/followers","following_url":"https://api.github.com/users/joshdholtz/following{/other_user}","gists_url":"https://api.github.com/users/joshdholtz/gists{/gist_id}","starred_url":"https://api.github.com/users/joshdholtz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshdholtz/subscriptions","organizations_url":"https://api.github.com/users/joshdholtz/orgs","repos_url":"https://api.github.com/users/joshdholtz/repos","events_url":"https://api.github.com/users/joshdholtz/events{/privacy}","received_events_url":"https://api.github.com/users/joshdholtz/received_events","type":"User","site_admin":false},"repo":{"id":53360747,"name":"fastlane","full_name":"joshdholtz/fastlane","owner":{"login":"joshdholtz","id":401294,"avatar_url":"https://avatars.githubusercontent.com/u/401294?v=3","gravatar_id":"","url":"https://api.github.com/users/joshdholtz","html_url":"https://github.com/joshdholtz","followers_url":"https://api.github.com/users/joshdholtz/followers","following_url":"https://api.github.com/users/joshdholtz/following{/other_user}","gists_url":"https://api.github.com/users/joshdholtz/gists{/gist_id}","starred_url":"https://api.github.com/users/joshdholtz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshdholtz/subscriptions","organizations_url":"https://api.github.com/users/joshdholtz/orgs","repos_url":"https://api.github.com/users/joshdholtz/repos","events_url":"https://api.github.com/users/joshdholtz/events{/privacy}","received_events_url":"https://api.github.com/users/joshdholtz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/joshdholtz/fastlane","description":"Connect all iOS deployment tools into one streamlined workflow","fork":true,"url":"https://api.github.com/repos/joshdholtz/fastlane","forks_url":"https://api.github.com/repos/joshdholtz/fastlane/forks","keys_url":"https://api.github.com/repos/joshdholtz/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joshdholtz/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joshdholtz/fastlane/teams","hooks_url":"https://api.github.com/repos/joshdholtz/fastlane/hooks","issue_events_url":"https://api.github.com/repos/joshdholtz/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/joshdholtz/fastlane/events","assignees_url":"https://api.github.com/repos/joshdholtz/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/joshdholtz/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/joshdholtz/fastlane/tags","blobs_url":"https://api.github.com/repos/joshdholtz/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joshdholtz/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joshdholtz/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/joshdholtz/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joshdholtz/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/joshdholtz/fastlane/languages","stargazers_url":"https://api.github.com/repos/joshdholtz/fastlane/stargazers","contributors_url":"https://api.github.com/repos/joshdholtz/fastlane/contributors","subscribers_url":"https://api.github.com/repos/joshdholtz/fastlane/subscribers","subscription_url":"https://api.github.com/repos/joshdholtz/fastlane/subscription","commits_url":"https://api.github.com/repos/joshdholtz/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/joshdholtz/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/joshdholtz/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/joshdholtz/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/joshdholtz/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/joshdholtz/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joshdholtz/fastlane/merges","archive_url":"https://api.github.com/repos/joshdholtz/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joshdholtz/fastlane/downloads","issues_url":"https://api.github.com/repos/joshdholtz/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/joshdholtz/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/joshdholtz/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/joshdholtz/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joshdholtz/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/joshdholtz/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/joshdholtz/fastlane/deployments","created_at":"2016-03-07T21:33:09Z","updated_at":"2016-03-07T21:33:12Z","pushed_at":"2016-03-11T18:53:27Z","git_url":"git://github.com/joshdholtz/fastlane.git","ssh_url":"git@github.com:joshdholtz/fastlane.git","clone_url":"https://github.com/joshdholtz/fastlane.git","svn_url":"https://github.com/joshdholtz/fastlane","homepage":"https://fastlane.tools","size":47917,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fastlane:master","ref":"master","sha":"51625ef26fb42b86bdcb895f47bebc1c99c713d6","user":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"repo":{"id":27442967,"name":"fastlane","full_name":"fastlane/fastlane","owner":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fastlane/fastlane","description":"Connect all iOS and Android deployment tools into one streamlined workflow","fork":false,"url":"https://api.github.com/repos/fastlane/fastlane","forks_url":"https://api.github.com/repos/fastlane/fastlane/forks","keys_url":"https://api.github.com/repos/fastlane/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastlane/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastlane/fastlane/teams","hooks_url":"https://api.github.com/repos/fastlane/fastlane/hooks","issue_events_url":"https://api.github.com/repos/fastlane/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/fastlane/fastlane/events","assignees_url":"https://api.github.com/repos/fastlane/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/fastlane/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/fastlane/fastlane/tags","blobs_url":"https://api.github.com/repos/fastlane/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastlane/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastlane/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastlane/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/fastlane/fastlane/languages","stargazers_url":"https://api.github.com/repos/fastlane/fastlane/stargazers","contributors_url":"https://api.github.com/repos/fastlane/fastlane/contributors","subscribers_url":"https://api.github.com/repos/fastlane/fastlane/subscribers","subscription_url":"https://api.github.com/repos/fastlane/fastlane/subscription","commits_url":"https://api.github.com/repos/fastlane/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastlane/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastlane/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastlane/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastlane/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/fastlane/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastlane/fastlane/merges","archive_url":"https://api.github.com/repos/fastlane/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastlane/fastlane/downloads","issues_url":"https://api.github.com/repos/fastlane/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/fastlane/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/fastlane/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/fastlane/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastlane/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/fastlane/fastlane/releases{/id}","deployments_url":"https://api.github.com/repos/fastlane/fastlane/deployments","created_at":"2014-12-02T17:00:38Z","updated_at":"2016-03-11T18:43:57Z","pushed_at":"2016-03-11T19:00:48Z","git_url":"git://github.com/fastlane/fastlane.git","ssh_url":"git@github.com:fastlane/fastlane.git","clone_url":"https://github.com/fastlane/fastlane.git","svn_url":"https://github.com/fastlane/fastlane","homepage":"https://fastlane.tools","size":50914,"stargazers_count":6174,"watchers_count":6174,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":738,"mirror_url":null,"open_issues_count":745,"forks":738,"open_issues":745,"watchers":6174,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/3699"},"html":{"href":"https://github.com/fastlane/fastlane/pull/3699"},"issue":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/3699"},"comments":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/3699/comments"},"review_comments":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/3699/comments"},"review_comment":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/3699/commits"},"statuses":{"href":"https://api.github.com/repos/fastlane/fastlane/statuses/2f0b7dfe5fe724ecd1559857d2fadb497abb9a72"}}}}