Skip to content

weslei-dias-vakt/auto-create-pr

 
 

Repository files navigation

GitHub and Jira

Audience

  • People that uses GitHub and JIRA. (See the video on the bottom)

Context

  • Whenever you finish your work, you want to open a PR. You have to go to github pr section and after many clicks you have PR opened. You have to go to JIRA dashboard and copy some information from there to fill your PR.

Goal

  • Standardize Pull Requests on GitHub
  • Simplify Pull Request creation, by typing one command and getting this result:

Instructions

  • Install npm
  • Create a file called '.config' with this content:
owner = squad
repo = project
body = the body of the PR
base = master
token = your personal access token for github, see https://github.com/settings/tokens
bodytemplate = true
bodytemplatename = custom-body-template.md
jirauser = your jira login, ex: [email protected]
jiraapitoken = your JIRA api token, create one on https://id.atlassian.com/manage-profile/security/api-tokens
jiracompany = your company host name on jira
  • Run npm npm start branch-name [jira-card-id] [draft]

Conditions:

  1. Your branch must be pushed
  2. It must have at least one commit

Customising template

  • You can add any template you wish, just upload the file or change the existing .md ones and change the bodytemplatename to your template.

Running from any terminal (Mac OS)

  • clone the repo somewhere (your-folder)
  • open the vi ~/.bash_profile and add this line alias createpr="cd ~/your-folder/github-pr && npm start $1"
  • run createpr branch-name

Notes:

  1. bodytemplate set to true means you will use the bodytemplatename as body of your pr instead of body value
  2. This .config file is hidden, nobody else besides yourself can see it because it was added on .gitignore.
  3. Square brackets means they are optional.
  4. Case your branch name matches the jira card id, just run (npm start branch-name)
  5. Case you want it to be draft, just run (npm start branch-name draft)

Star ☆ the repo to increase the engagement

github-jira.mov
  • Thank you

About

Javascript made to create PR via command line

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%