github_workflow 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1b78a0939fa7402d8285225f9b0781679f0cb79763bffec90ef48e3cd42cd4f1
4
- data.tar.gz: 23c6d828058ea2297bf8aa56c8845b404df54e27873e6cf4c96bbf3de988b68e
3
+ metadata.gz: 6bcca8d3fca22bc0cf07160f662201e0908833c9070e2cb2b97403bf82d2419e
4
+ data.tar.gz: f0b4be844e856e5548ecbafd9b8a2dff22c3f70670ada6d3528575bf61379d10
5
5
  SHA512:
6
- metadata.gz: b402e5c220a787564bcc99dc1c762d8f32d793f02540d8bb3988e9cd8baf7f5da6fa016146e2ce1abdb5e4a731f2266b377e316e1f518f8de236471374398b1f
7
- data.tar.gz: d4608f84dc12e576cbffa6b97d057bf8e563d81ff5af2572a3ff50de9d3ee2aeb398e812b8efa17118ea401a824d73c5edde8598ba1426cc275bb19e940a039b
6
+ metadata.gz: 5094dc1f9323c9b29d901b01929d132a83fc948bfdca53d3acdb367afdc3a7c4a965227e45a4ae52f36a2291defde01be718a96815bc99ef42f54351146f12c5
7
+ data.tar.gz: d90d5ff5f4cc9617712186a8f07fb65f62b9c0bdb1e270809fbd47d429e5c075497189d2c113513791aadcca8e85613d273fa55cd16bb91ce4b072023ef068d1
@@ -82,7 +82,7 @@ module GithubWorkflow
82
82
  def status
83
83
  ensure_github_config_present
84
84
  ensure_origin_exists
85
- response = JSON.parse(github_client.get("repos/#{user_and_repo}/statuses/#{current_branch}?access_token=#{oauth_token}").body)
85
+ response = JSON.parse(github_client.get("repos/#{user_and_repo}/statuses/#{current_branch}").body)
86
86
 
87
87
  if response.empty?
88
88
  alert "No statuses yet. Have you pushed your branch?"
@@ -111,7 +111,7 @@ module GithubWorkflow
111
111
  desc "open", "Open issue or PR in browser"
112
112
  def open
113
113
  ensure_github_config_present
114
- response = JSON.parse(github_client.get("repos/#{user_and_repo}/issues/#{issue_number_from_branch}?access_token=#{oauth_token}").body)
114
+ response = JSON.parse(github_client.get("repos/#{user_and_repo}/issues/#{issue_number_from_branch}").body)
115
115
  `/usr/bin/open -a "/Applications/Google Chrome.app" '#{response["html_url"]}'`
116
116
  end
117
117
 
@@ -171,15 +171,15 @@ module GithubWorkflow
171
171
 
172
172
  no_tasks do
173
173
  def get_issue(id)
174
- JSON.parse(github_client.get("repos/#{user_and_repo}/issues/#{id}?access_token=#{oauth_token}").body)
174
+ JSON.parse(github_client.get("repos/#{user_and_repo}/issues/#{id}").body)
175
175
  end
176
176
 
177
177
  def get_pr(id)
178
- JSON.parse(github_client.get("repos/#{user_and_repo}/pulls/#{id}?access_token=#{oauth_token}").body)
178
+ JSON.parse(github_client.get("repos/#{user_and_repo}/pulls/#{id}").body)
179
179
  end
180
180
 
181
181
  def get_prs_list
182
- JSON.parse(github_client.get("repos/#{user_and_repo}/pulls?access_token=#{oauth_token}&per_page=100").body)
182
+ JSON.parse(github_client.get("repos/#{user_and_repo}/pulls&per_page=100").body)
183
183
  end
184
184
 
185
185
  def create_branch
@@ -204,7 +204,7 @@ module GithubWorkflow
204
204
  labels: trello_card.labels.map(&:name)
205
205
  }
206
206
 
207
- response = JSON.parse(github_client.post("repos/#{user_and_repo}/issues?access_token=#{oauth_token}", issue_params.to_json).body)
207
+ response = JSON.parse(github_client.post("repos/#{user_and_repo}/issues", issue_params.to_json).body)
208
208
 
209
209
  @issue_id = response["number"]
210
210
  end
@@ -238,7 +238,7 @@ module GithubWorkflow
238
238
  end
239
239
 
240
240
  def current_github_username
241
- JSON.parse(github_client.get("user?access_token=#{oauth_token}").body)["login"]
241
+ JSON.parse(github_client.get("user").body)["login"]
242
242
  end
243
243
 
244
244
  def set_trello_card(type:)
@@ -289,7 +289,7 @@ module GithubWorkflow
289
289
 
290
290
  def create_issue
291
291
  github_client.post(
292
- "repos/#{user_and_repo}/issues?access_token=#{oauth_token}",
292
+ "repos/#{user_and_repo}/issues",
293
293
  JSON.generate(
294
294
  {
295
295
  title: options[:name]
@@ -313,7 +313,7 @@ module GithubWorkflow
313
313
 
314
314
  def convert_issue_to_pr
315
315
  github_client.post(
316
- "repos/#{user_and_repo}/pulls?access_token=#{oauth_token}",
316
+ "repos/#{user_and_repo}/pulls",
317
317
  JSON.generate(
318
318
  {
319
319
  head: current_branch,
@@ -345,7 +345,7 @@ module GithubWorkflow
345
345
  end
346
346
 
347
347
  def branch_name_for_issue_number
348
- issue = JSON.parse(github_client.get("repos/#{user_and_repo}/issues/#{issue_id}?access_token=#{oauth_token}").body)
348
+ issue = JSON.parse(github_client.get("repos/#{user_and_repo}/issues/#{issue_id}").body)
349
349
  "#{issue['number']}_#{issue['title'].strip.downcase.gsub(/[^a-zA-Z0-9]/, '_').squeeze("_")}"
350
350
  end
351
351
 
@@ -353,6 +353,7 @@ module GithubWorkflow
353
353
  Faraday.new(url: "https://api.github.com") do |faraday|
354
354
  faraday.request :url_encoded
355
355
  faraday.adapter Faraday.default_adapter
356
+ faraday.authorization :Bearer, oauth_token
356
357
  end
357
358
  end
358
359
 
@@ -399,7 +400,7 @@ module GithubWorkflow
399
400
  end
400
401
 
401
402
  def commits_for_range
402
- JSON.parse(github_client.get("repos/#{user_and_repo}/compare/#{options[:commit_range]}?access_token=#{oauth_token}").body)
403
+ JSON.parse(github_client.get("repos/#{user_and_repo}/compare/#{options[:commit_range]}").body)
403
404
  end
404
405
 
405
406
  def pull_request_in_commit_range
@@ -409,10 +410,10 @@ module GithubWorkflow
409
410
 
410
411
  prs = pr_ids.map do |id|
411
412
  say_info("Fetching Pull Request ##{id}")
412
- pr = github_client.get("repos/#{user_and_repo}/pulls/#{id}?access_token=#{oauth_token}")
413
+ pr = github_client.get("repos/#{user_and_repo}/pulls/#{id}")
413
414
 
414
415
  if pr.status == 404
415
- JSON.parse(github_client.get("repos/#{user_and_repo}/issues/#{id}?access_token=#{oauth_token}").body)
416
+ JSON.parse(github_client.get("repos/#{user_and_repo}/issues/#{id}").body)
416
417
  else
417
418
  JSON.parse(pr.body)
418
419
  end
@@ -1,3 +1,3 @@
1
1
  module GithubWorkflow
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Liscio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-28 00:00:00.000000000 Z
11
+ date: 2021-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor