A GitHub App built with Probot that allows Pull Request authors to self-approve their Pull Requests.
Special thanks to dkhmelenko/autoapproval for providing some inspiration and also some code implementation for this App.
For some repositories, the Pull Request have to be approved before it can be merged. And this GitHub App allows some whitelisted maintainers to self-approve their Pull Requests, so they can directly approve and merge their own Pull Requests.
# Install dependencies
npm install
# Build the app
npm run build
# Run the bot
npm start
# Run tests, `npm run build` should be run first
npm run test
.env
from the .env.example
file and fill in the required values:APP_ID
: the ID of the app, which you can get from the app settings page.GITHUB_CLIENT_ID
: the Client ID of the app, which you can get from the app settings page.GITHUB_CLIENT_SECRET
: the Client Secret of the app, which you can generate and get from the app settings page.WEBHOOK_SECRET
: the Webhook Secret that you generated when you created the app.PRIVATE_KEY
: the contents of the private key you downloaded after creating the app.npm install
to install the dependenciesnpm build
to build the app.npm start
to start the app.Set the Webhook URL of your GitHub App to your domain or ip:port
.
Go to the .env
file and change the value of PORT
to the port you want to use.
In order to use the bot, the config file should be provided. Config file should be defined in your repository. Config file is the yml file with the path .github/self-approval-pull-request.yml
. And the file should have these 3 entries: self_approval_comments
, from_author
and apply_labels
.
Define the list of comments that will be considered as self-approval.
self_approval_comments:
- "I self-approve!"
- "I self-certify!"
Define the list of GitHub users who can self-approve their Pull Request.
from_author:
- "Cubik65536"
- "<GitHub ID of other project maintainer>"
Assign an empty array if you want everyone can self-approve their Pull Requests (example: from_author: []
).
Defines the list of labels on PR, which should be added once PR was approved. For example:
apply_labels:
- "can-be-merged"
- "self-approved"
Assign an empty array if no labels should be applied to PRs (example: apply_labels: []
).
If you have suggestions for how self-approval could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
For more, check out the Contributing Guide.
ISC © 2022 Cubik Technology & Cubik65536