Skip to content

Instantly share code, notes, and snippets.

@brenogcota
Created March 27, 2023 19:44
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 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