Skip to content

Instantly share code, notes, and snippets.

@brenogcota
Created March 27, 2023 19:44
Show Gist options
  • Save brenogcota/873ddc51a9b389b7bc2e09014d6759ee to your computer and use it in GitHub Desktop.
Save brenogcota/873ddc51a9b389b7bc2e09014d6759ee to your computer and use it in GitHub Desktop.
Create PR with Jira task id
function pr(){
repo="${PWD##*/}"
branch_name=$(git symbolic-ref -q HEAD)
task=$(echo $branch_name | awk -F/ '{print $NF}')
message=$(echo $(git log -n 1 --pretty=format:%B))
gh pr create --title "$message" --body "## $message [$task](https://<your-org>.atlassian.net/browse/$task)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment