Automate Github Pull Requests using Reactions
This simple project allows github projects to be automated. It uses “reaction” as a voting mechanism to automatically merge (or close) pull requests.
The file .gitconsensus.yaml needs to be placed in the repository to be managed. Any rule set to false or ommitted will be skipped.
# Add extra labels for the vote counts and age when merging extra_labels: false # Minimum number of votes quorum: 5 # Required percentage of "yes" votes threshold: 0.65 # Only process votes by contributors contributors_only: false # Only process votes by collaborators collaborators_only: false # When defined only process votes from these github users whitelist: - alice - bob - carol # Number of days after last action (commit or opening the pull request) before issue can be merged mergedelay: 3 # Number of days after last action (commit or opening the pull request) before issue is autoclosed timeout: 30
Votes are made by using reactions on the top level comment of the Pull Request.
You will be asked for your username, password, and 2fa token (if configured). This will be used to get an authentication token from Github that will be used in place of your username and password (which are never saved).
Merge all pull requests that meet consensus rules.
gitconsensus merge USERNAME REPOSITORY
Close all pull requests that have passed the “timeout” date (if it is set).
gitconsensus close USERNAME REPOSITORY
Get detailed infromation about a specific pull request and what rules it passes.
gitconsensus info USERNAME REPOSITORY PR_NUMBER
Close specific pull request, including any labels and comments that normally would be sent.
gitconsensus forceclose USERNAME REPOSITORY PR_NUMBER
Merge specific pull request, including any labels and comments that normally would be sent.
gitconsensus forcemerge USERNAME REPOSITORY PR_NUMBER
Any Pull Request with a WIP or DONTMERGE label (case insensitive) will be skipped over.