https://github.com/yegor256/mergem
A command line client to GitHub API that tries to deal with incoming Pull Requests
https://github.com/yegor256/mergem
devops devops-tools github-bot github-client pull-requests
Last synced: 11 months ago
JSON representation
A command line client to GitHub API that tries to deal with incoming Pull Requests
- Host: GitHub
- URL: https://github.com/yegor256/mergem
- Owner: yegor256
- License: mit
- Created: 2022-11-04T04:40:16.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-22T10:38:55.000Z (over 1 year ago)
- Last Synced: 2024-05-22T11:44:57.382Z (over 1 year ago)
- Topics: devops, devops-tools, github-bot, github-client, pull-requests
- Language: Ruby
- Homepage:
- Size: 392 MB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://www.elegantobjects.org)
[](http://www.rultor.com/p/yegor256/mergem)
[](https://www.jetbrains.com/ruby/)
[](https://github.com/yegor256/mergem/actions/workflows/rake.yml)
[](http://badge.fury.io/rb/mergem)
[](https://github.com/yegor256/mergem/blob/master/LICENSE.txt)
[](https://codecov.io/github/yegor256/mergem?branch=master)
[](https://hitsofcode.com/view/github/yegor256/mergem)
This simple script may help you deal with pull requests
coming to your GitHub repositories from robots:
```bash
$ gem install mergem
```
Then, run it locally and read its output:
```bash
$ mergem --repo yegor256/mergem --verbose --token
```
First, it will find all pull requests in `yegor256/mergem` GitHub repository,
which were not yet discussed by the owner of the token. Then, it will ignore
those pull requests that are coming not
from [Renovate](https://github.com/apps/renovate)
or [Dependabot](https://github.com/dependabot). Then, it will
post `@rultor merge` text message to each pull request left in the list.
## Token
`mergem` requires a GitHub token to be passed via the `--token` option. To
obtain one, go to your GitHub account, then navigate to "Settings," and then
to "Developer Settings" (or simply use
the [link](https://github.com/settings/tokens).)
### Classic Token
You can create a classic token with the `public_repo` ("Access public
repositories") scope. It will grant `mergem` all the necessary permissions to
read and write comments on repositories.
### Fine-grained Token
Another option is to create a fine-grained token with "All Repositories" access.
In this case, you will need to assign the following permissions to the token:
* Issues, "Read and write"
* Pull requests, "Read and write"
* Contents, "Read and write"
Please note that fine-grained tokens might encounter issues with repositories
not owned by you or owned by an organization. In such cases, you may need to
obtain additional approval from the organization.
> During the beta, organizations must opt in to fine-grained personal access
> tokens. If your organization has not already opted-in, then you will be
> prompted
> to opt-in and set policies when you follow the steps below.
You can find information about setting a personal access token policy for your
organization
right [here](https://docs.github.com/en/organizations/managing-programmatic-access-to-your-organization/setting-a-personal-access-token-policy-for-your-organization).
## How to contribute
Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
Make sure your build is green before you contribute your pull request. You will
need to have [Ruby](https://www.ruby-lang.org/en/) 2.3+
and [Bundler](https://bundler.io/) installed. Then:
```
$ bundle update
$ bundle exec rake
```
If it's clean and you don't see any error messages, submit your pull request.
In order to run a single test:
```
$ bundle exec ruby test/test_askrultor.rb
```