pull-request 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/pr +8 -8
- data/pullrequest.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 261192d356923a392825fd2fe7d5c35c2ce231c24176744cb2723805c9dd061c
|
4
|
+
data.tar.gz: 76f0369668811d60647bef5dfaed3933e23c79c159e87f146c08ac7d5470b03b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3463de3bc7cf7dc0eda769fcb1cf3c633161d00eecd2b51e0006d09ce0c3e9a226cdeccc50722d25b8bcda7922d7ac9790094eb1448a71468599439b307c6b4
|
7
|
+
data.tar.gz: e0e855760653160be77eaf4112baedba74cdce3737e26ae6ff0f02ee83542636b7131cd80ac1b088d365bcf05c962f234666d882ccc72ab1836b3de142c65121
|
data/exe/pr
CHANGED
@@ -3,7 +3,6 @@ require "optionparser"
|
|
3
3
|
require "active_support"
|
4
4
|
require "active_support/all"
|
5
5
|
|
6
|
-
@estimation = nil
|
7
6
|
@simulate = false
|
8
7
|
@issue_number = nil
|
9
8
|
|
@@ -44,9 +43,6 @@ end
|
|
44
43
|
|
45
44
|
OptionParser.new do |opts|
|
46
45
|
opts.banner = "Usage: pr [options] [title]\nDefaults: pr" + File::SEPARATOR
|
47
|
-
opts.on("-e", "--estimation ESTIMATION", Integer, "Estimated time in hours.") do |e|
|
48
|
-
@estimation = e.presence
|
49
|
-
end
|
50
46
|
opts.on("-s", "--simulate", "Simulate the actions: prints out the write-commands instead of executing them, prefixed with ▶️ .") do
|
51
47
|
@simulate = true
|
52
48
|
end
|
@@ -63,11 +59,12 @@ branch += "#{@issue_number}_" if @issue_number
|
|
63
59
|
branch += name.parameterize.underscore
|
64
60
|
|
65
61
|
title = name
|
66
|
-
title += " [#{@estimation}]" if @estimation
|
67
62
|
|
68
63
|
body_lines = []
|
64
|
+
path = ".github/pull_request_template.md"
|
65
|
+
body_lines.push File.read(path) if File.exists?(path)
|
69
66
|
body_lines.push "fixes ##{@issue_number}" if @issue_number
|
70
|
-
body = body_lines.join("\n")
|
67
|
+
body = body_lines.join("\n\n")
|
71
68
|
|
72
69
|
base_branch = current_branch
|
73
70
|
exit 1 unless ["master", "main", "develop"].include?(base_branch) || confirm("Your base branch #{base_branch} doesn't seem to be a common base branch name. Do you want to continue?")
|
@@ -78,10 +75,13 @@ puts "Creating branch #{branch}"
|
|
78
75
|
sh "git checkout -b #{branch}"
|
79
76
|
|
80
77
|
puts "Creating empty commit"
|
81
|
-
|
78
|
+
commit_message = "initial commit for #{title}"
|
79
|
+
commit_message += ", fixes ##{@issue_number}" if @issue_number
|
80
|
+
sh "git commit -m '#{commit_message}' --allow-empty"
|
82
81
|
|
83
82
|
puts "Pushing to origin"
|
84
83
|
sh "git push -u origin #{branch}"
|
85
84
|
|
86
85
|
puts "Creating pull request"
|
87
|
-
|
86
|
+
ENV["PR_BODY"] = body_lines.join("\n")
|
87
|
+
sh "gh pr create --draft --title '#{title}' --body \"$PR_BODY\" --base #{base_branch}"
|
data/pullrequest.gemspec
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pull-request
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Ravens
|
8
8
|
- David Dufour-Boivin
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
|
-
description:
|
56
|
+
description:
|
57
57
|
email:
|
58
58
|
- jens@nerdgeschoss.de
|
59
59
|
- david@nerdgeschoss.de
|
@@ -79,7 +79,7 @@ homepage: https://nerdgeschoss.de
|
|
79
79
|
licenses:
|
80
80
|
- MIT
|
81
81
|
metadata: {}
|
82
|
-
post_install_message:
|
82
|
+
post_install_message:
|
83
83
|
rdoc_options: []
|
84
84
|
require_paths:
|
85
85
|
- lib
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
97
|
rubygems_version: 3.3.7
|
98
|
-
signing_key:
|
98
|
+
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: Automatically create PRs for GitHub Flow
|
101
101
|
test_files: []
|