Skip to content

Instantly share code, notes, and snippets.

@jagannathBhat
Created June 17, 2022 05:23
Show Gist options
  • Save jagannathBhat/42a584748d97fe134f0abadb191ef29a to your computer and use it in GitHub Desktop.
Save jagannathBhat/42a584748d97fe134f0abadb191ef29a to your computer and use it in GitHub Desktop.
pr_maker
#!/usr/bin/env ruby
require 'find'
require 'json'
# Name of the branch in which the changes will be made to
branch_name = 'upgrade-eslint-plugin-neeto-to-latest-commit'
# Commit message for all the changes
commit_msg = 'Upgrade eslint-plugin-neeto to latest commit'
# Title of the PR to be created
pr_title = 'Upgrade eslint-plugin-neeto to latest commit'
# Apps in which the PRs will be created
# Apps with `prod` next to the name are in production
@apps = [
'neeto-auth-web',
'neeto-analytics-web',
'neeto-analyzer-web',
'neeto-cal-web', # prod
'neeto-changelog-web',
'neeto-chat-web', # prod
'neeto-course-web',
'neeto-crm-web',
'neeto-desk-web', # prod
'neeto-engage-web',
'neeto-form-web', # prod
'neeto-grow-web',
'neeto-invisible-web',
'neeto-invoice-web', # prod
'neeto-kb-web', # prod
'neeto-planner-web', # prod
'neeto-popups-web',
'neeto-quiz-web',
'neeto-replay-web',
'neeto-runner-web', # prod
'neeto-store-web',
'neeto-testify-web',
'neeto-wireframe-web'
]
@apps.each do |app|
Dir.chdir('/Users/bhat/repos/github/bigbinary')
`[ ! -d "#{app}" ] && gh repo clone "bigbinary/#{app}"`
Dir.chdir(app)
puts "In #{app}"
`git checkout master`
puts 'Pulling master..'
`git pull`
`git checkout -b #{branch_name}`
`git checkout #{branch_name}`
puts 'Executing commands...'
# Custom commands
# TODO Add commands to be executed here
# Pushing changes
`git add .`
`git commit -m "#{commit_msg}"`
puts 'Committed changes'
puts 'Pushing...'
`git push -u origin #{branch_name}`
`gh pr create -t "#{pr_title}" -B "master" -b "" -a "@me"`
puts 'Opening pull request...'
`gh pr view --web`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment