github_workflow 0.3.6 → 0.3.9
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 +4 -4
- data/.ruby-version +1 -1
- data/README.md +17 -0
- data/lib/github_workflow/cli.rb +14 -5
- data/lib/github_workflow/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0d0091f831042df6bf6521994c7e84ec07b330acf6bb0441032a10cd74cb8b0
|
4
|
+
data.tar.gz: 9a47a0432865d512d66b180b6b53ca7758738d9573aaa56065279c2d5bc9d80e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e68ef334f027cc1c297af90396cfef2da209d2011ff138359a9d5774b50ad0a3325240dc94636f33083e5072138a5e2b5c63738ef2a7ef9ef8fee8634601aaf8
|
7
|
+
data.tar.gz: ffb8cdd1ac843d06894310e226cf42e11a2bc0fc2976e5489e069e0ceff972aa325f7e7fa82067a6ba7fa14ee77f407029abe4a965912367f674e73e41e25223
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.7.
|
1
|
+
2.7.4
|
data/README.md
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
# Configuration
|
2
|
+
|
3
|
+
Each repository should contain its own config (`.github_workflow`), which should look like this:
|
4
|
+
```
|
5
|
+
{
|
6
|
+
"oauth_token": "TOKEN",
|
7
|
+
"user_and_repo": "ORG/REPO",
|
8
|
+
"trello_key": "KEY",
|
9
|
+
"trello_token": "TOKEN",
|
10
|
+
"trello_board_id": "BOARD_ID",
|
11
|
+
"trello_platform_board_id": "BOARD_ID"
|
12
|
+
}
|
13
|
+
```
|
14
|
+
Optionally, all general information except `user_and_repo` could be extracted to global config in your home directory
|
15
|
+
with the same name (~/.github_workflow)
|
16
|
+
|
1
17
|
# Github Workflow
|
2
18
|
|
3
19
|
```
|
@@ -12,4 +28,5 @@ Commands:
|
|
12
28
|
github_workflow push_and_pr # Push branch to origin and convert Issue to Pull Request
|
13
29
|
github_workflow start -i, --issue-id=ISSUE_ID # Create branch named with issue number and issue title
|
14
30
|
github_workflow status # Check PR CI status
|
31
|
+
github_workflow reviews # Print out reviewers list and their PRs count
|
15
32
|
```
|
data/lib/github_workflow/cli.rb
CHANGED
@@ -10,7 +10,7 @@ require "trello"
|
|
10
10
|
module GithubWorkflow
|
11
11
|
class Cli < Thor
|
12
12
|
PROCEED_TEXT = "Proceed? [y,yes]: ".freeze
|
13
|
-
|
13
|
+
CONFIG_FILE_NAME = ".github_workflow".freeze
|
14
14
|
GITHUB_CONFIG = <<~TEXT
|
15
15
|
{
|
16
16
|
"oauth_token": "TOKEN",
|
@@ -179,7 +179,7 @@ module GithubWorkflow
|
|
179
179
|
end
|
180
180
|
|
181
181
|
def get_prs_list
|
182
|
-
JSON.parse(github_client.get("repos/#{user_and_repo}/pulls
|
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
|
@@ -262,7 +262,7 @@ module GithubWorkflow
|
|
262
262
|
end
|
263
263
|
|
264
264
|
def ensure_github_config_present
|
265
|
-
if
|
265
|
+
if (JSON.parse(GITHUB_CONFIG).keys - project_config.keys).any?
|
266
266
|
failure("Please add `.github_workflow` file containing:\n#{GITHUB_CONFIG}")
|
267
267
|
end
|
268
268
|
end
|
@@ -275,7 +275,15 @@ module GithubWorkflow
|
|
275
275
|
end
|
276
276
|
|
277
277
|
def project_config
|
278
|
-
@project_config ||=
|
278
|
+
@project_config ||=
|
279
|
+
begin
|
280
|
+
global_config_path = Pathname.new(Dir.home).join(CONFIG_FILE_NAME)
|
281
|
+
result = File.exists?(global_config_path) ? JSON.parse(File.read(global_config_path)) : {}
|
282
|
+
local_config_data = JSON.parse(File.read(CONFIG_FILE_NAME))
|
283
|
+
result.merge(local_config_data)
|
284
|
+
rescue
|
285
|
+
{}
|
286
|
+
end
|
279
287
|
end
|
280
288
|
|
281
289
|
def oauth_token
|
@@ -383,7 +391,8 @@ module GithubWorkflow
|
|
383
391
|
def stash_pop
|
384
392
|
if @stashed
|
385
393
|
say_info("Stash pop")
|
386
|
-
`git stash pop
|
394
|
+
`git stash pop`
|
395
|
+
nil
|
387
396
|
end
|
388
397
|
end
|
389
398
|
|
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
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Liscio
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -114,7 +114,7 @@ dependencies:
|
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '10.0'
|
117
|
-
description:
|
117
|
+
description:
|
118
118
|
email:
|
119
119
|
- bliscio@daisybill.com
|
120
120
|
executables:
|
@@ -135,7 +135,7 @@ homepage: https://github.com/daisybill/github_workflow
|
|
135
135
|
licenses:
|
136
136
|
- MIT
|
137
137
|
metadata: {}
|
138
|
-
post_install_message:
|
138
|
+
post_install_message:
|
139
139
|
rdoc_options: []
|
140
140
|
require_paths:
|
141
141
|
- lib
|
@@ -150,8 +150,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
|
-
rubygems_version: 3.1.
|
154
|
-
signing_key:
|
153
|
+
rubygems_version: 3.1.6
|
154
|
+
signing_key:
|
155
155
|
specification_version: 4
|
156
156
|
summary: DaisyBill's internal github workflows
|
157
157
|
test_files: []
|