@@ -222,11 +222,16 @@ BASE_BRANCH_MAJOR_VERSION = if BASE_BRANCH == 'master'
222
222
Integer ( BASE_BRANCH [ /^\d +/ ] )
223
223
end
224
224
225
- def create_pull_request ( project_name , branch , base = BASE_BRANCH )
225
+ def create_pull_request ( project_name , branch , custom_pr_comment , base = BASE_BRANCH )
226
+ body = [
227
+ "These are some updates, generated from rspec-dev's rake tasks." ,
228
+ custom_pr_comment
229
+ ] . join ( "\n \n " ) . strip
230
+
226
231
github_client . create_pull_request (
227
232
"rspec/#{ project_name } " , base , branch ,
228
233
"Updates from rspec-dev (#{ Date . today . iso8601 } )" ,
229
- "These are some updates, generated from rspec-dev's rake tasks."
234
+ body
230
235
)
231
236
end
232
237
@@ -296,8 +301,8 @@ namespace :travis do
296
301
end
297
302
298
303
desc "Updates the travis files and creates a PR"
299
- task :create_pr_with_updates do
300
- force_update update_travis_files_in_repos
304
+ task :create_pr_with_updates , :custom_pr_comment do | t , args |
305
+ force_update ( update_travis_files_in_repos , args [ :custom_pr_comment ] )
301
306
end
302
307
end
303
308
@@ -374,8 +379,8 @@ namespace :common_plaintext_files do
374
379
end
375
380
376
381
desc "Updates the common plaintext files files and creates a PR"
377
- task :create_pr_with_updates do
378
- force_update update_common_plaintext_files_in_repos
382
+ task :create_pr_with_updates , :custom_pr_comment do | _t , args |
383
+ force_update ( update_common_plaintext_files_in_repos , args [ :custom_pr_comment ] )
379
384
end
380
385
end
381
386
@@ -465,16 +470,16 @@ def each_project_with_common_build(&b)
465
470
each_project ( :except => except , &b )
466
471
end
467
472
468
- def force_update ( branch )
473
+ def force_update ( branch , custom_pr_comment )
469
474
each_project_with_common_build do |name |
470
475
unless system ( "git push origin #{ branch } " )
471
476
puts "Push failed, force? (y/n)"
472
477
if STDIN . gets . downcase =~ /^y/
473
478
sh "git push origin +#{ branch } "
474
479
end
475
- create_pull_request ( name , branch ) rescue nil
480
+ create_pull_request ( name , branch , custom_pr_comment ) rescue nil
476
481
else
477
- create_pull_request ( name , branch )
482
+ create_pull_request ( name , branch , custom_pr_comment )
478
483
end
479
484
sh "git checkout #{ BASE_BRANCH } && git branch -D #{ branch } " # no need to keep it around
480
485
end
0 commit comments