roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.02k stars 204 forks source link

Create python script for merging pull requests #587

Closed gavv closed 8 months ago

gavv commented 9 months ago

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.