pull-request 0.5.0 → 0.6.1
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: 0ec03a95ae507e21ea594a9be05dfd322c9398d2bd79c24880d8bd3436a6a1e4
|
4
|
+
data.tar.gz: dab00856279d92ccc0f28147651a62ace011c97fb2d9305043550bfa6ac1f664
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70b786ae43c19db210e9f69dcbc1967b6368e55977b1eca71dd7ec94fbbf552dca60a54afb9c2ecf099b81d8a2c9d16f3ebef03dc765dfa2f9a0ec22a3d1a57b
|
7
|
+
data.tar.gz: a73cb6dcf1c81121a254dd8506053b69b69d20d80dc7f0324518893d5622eaf44db2948d607e865f36718f2f9033f92fe98c4e565b5e1287940ca890f68fbd56
|
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.exist?(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.1
|
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-06-14 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: []
|