Created
May 26, 2021 08:12
-
-
Save markburns/cbb49e5215c3f639bf82111d614f1dfe to your computer and use it in GitHub Desktop.
create draft pr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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