fastlane-plugin-create_bitbucket_pull_request 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b09eafbff0b7cff6f4664134ac1ee16a3ef6ea125260d1ecce4b7711c0bf2c5
|
4
|
+
data.tar.gz: 2bc3007e3ebd7714e9314204f407d261c3e23fc39103d6a59501982979d37c71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38086db1254f651e09508d05120fddb6dee28aa955ec570517603a5f841a10133a8e2c8c725738c450be21ea022895472909a54585747a566331e7d4bb6006eb
|
7
|
+
data.tar.gz: f49ccc4e4bbf03554326d61b38caaa9651c91356e954fd703f28e1981bc42b0e1f972b367c4a7ffa565287aad6c79b931d4275ec1834e99dcb96524bd4bded78
|
@@ -7,17 +7,17 @@ require 'json'
|
|
7
7
|
module Fastlane
|
8
8
|
module Actions
|
9
9
|
class CreateBitbucketPullRequestAction < Action
|
10
|
-
def self.run(
|
11
|
-
UI.message("Creating new bitbucket pull request from '#{
|
10
|
+
def self.run(params)
|
11
|
+
UI.message("Creating new bitbucket pull request from '#{params[:head]}' to branch '#{params[:target]}' of '#{params[:owner]}/#{params[:repository]}'")
|
12
12
|
response = JSON.parse(Net::HTTP.post(
|
13
|
-
URI("https://api.bitbucket.org/2.0/repositories/#{
|
13
|
+
URI("https://api.bitbucket.org/2.0/repositories/#{params[:owner]}/#{params[:repository]}/pullrequests"),
|
14
14
|
{
|
15
|
-
"destination": { "branch": { "name":
|
16
|
-
"source": { "branch": { "name":
|
17
|
-
"title":
|
18
|
-
"description":
|
15
|
+
"destination": { "branch": { "name": params[:target] } },
|
16
|
+
"source": { "branch": { "name": params[:head] } },
|
17
|
+
"title": params[:title],
|
18
|
+
"description": params[:description]
|
19
19
|
}.to_json,
|
20
|
-
"Authorization": "Basic #{Base64.encode64("#{
|
20
|
+
"Authorization": "Basic #{Base64.encode64("#{params[:username]}:#{params[:password]}").gsub("\n", '')}",
|
21
21
|
"Content-Type": 'application/json'
|
22
22
|
).body)
|
23
23
|
|
@@ -25,7 +25,7 @@ module Fastlane
|
|
25
25
|
raise(response['error']['message'])
|
26
26
|
else
|
27
27
|
UI.message('The pull request has been created successfully')
|
28
|
-
UI.message(
|
28
|
+
UI.message((response['links']['html']['href']).to_s)
|
29
29
|
response['links']['html']['href']
|
30
30
|
end
|
31
31
|
end
|