Add script that will automate linking commit messages to issues when merging PRs.
New script should be called pr.py and placed to scripts folder. It should have two commands:
./scripts/pr.py reword 123
This command should find pull request 123, fetch it locally, run rebase, edit each commit message, and push it back.
Edit message should be edited to have the following format: gh-456 <message>, where 456 is the number of the issue linked to pull request 123.
The script should fail if PR's author didn't allow pushing to PR's branch.
The second command should be:
./scripts/pr.py merge 123
This command will tell github to merge PR 123 using rebase method.
The script should use gh and git commands instead of working with github API directly. If there is a need to use API, it can be done using gh api subcommand. This approach allows to avoid implementing authentication, it can be managed by gh.
Add script that will automate linking commit messages to issues when merging PRs.
New script should be called
pr.py
and placed toscripts
folder. It should have two commands:This command should find pull request
123
, fetch it locally, run rebase, edit each commit message, and push it back.Edit message should be edited to have the following format:
gh-456 <message>
, where456
is the number of the issue linked to pull request123
.The script should fail if PR's author didn't allow pushing to PR's branch.
The second command should be:
This command will tell github to merge PR
123
using rebase method.The script should use
gh
andgit
commands instead of working with github API directly. If there is a need to use API, it can be done usinggh api
subcommand. This approach allows to avoid implementing authentication, it can be managed bygh
.