Skip to content

Instantly share code, notes, and snippets.

@markburns
Created May 26, 2021 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markburns/cbb49e5215c3f639bf82111d614f1dfe to your computer and use it in GitHub Desktop.
Save markburns/cbb49e5215c3f639bf82111d614f1dfe to your computer and use it in GitHub Desktop.
create draft pr
#!/usr/bin/env bash
branch=${1:-$(current-branch)}
base_branch=${2:-develop}
# git push --force-with-lease || git push --set-upstream origin $branch
mkdir -p tmp/.github
VIM_FILE='tmp/.github/pr.md'
rm -f tmp/.github/pr.md
cp .github/PULL_REQUEST_TEMPLATE.md $VIM_FILE
sed -i "s/TICKET_NUMBER/$(flow-jira-current-ticket)/g" $VIM_FILE
sed -i "s/Link to Jira Ticket/$(flow-jira-current-ticket)/g" $VIM_FILE
vim $VIM_FILE +4
flow-pr-create $branch $base_branch
#!/usr/bin/env ruby
branch = ARGV[0].chomp
base_branch = ARGV[1].chomp
title=`flow-jira-title`.chomp
id=`flow-jira-current-ticket`.chomp
title="#{id}: #{title}"
# create a draft PR to develop
body=File.read 'tmp/.github/pr.md'
IO.popen ['gh', 'pr', 'create', '--draft',
'--base', base_branch,
'--head', branch,
'--title', title,
'--body', body ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment