https://github.com/diegolnasc/gotcha
A :robot: to improve pull request quality.
https://github.com/diegolnasc/gotcha
github-app golang pull-requests quality review
Last synced: 28 days ago
JSON representation
A :robot: to improve pull request quality.
- Host: GitHub
- URL: https://github.com/diegolnasc/gotcha
- Owner: diegolnasc
- License: apache-2.0
- Created: 2021-12-13T14:55:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-01T20:25:55.000Z (almost 2 years ago)
- Last Synced: 2025-03-03T12:44:36.706Z (about 2 months ago)
- Topics: github-app, golang, pull-requests, quality, review
- Language: Go
- Homepage:
- Size: 407 KB
- Stars: 30
- Watchers: 2
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
Gotcha Bot :robot:
A app to automate engineers tasks
[](https://godoc.org/github.com/diegolnasc/gotcha)
[](https://goreportcard.com/report/github.com/diegolnasc/gotcha)

[](https://github.com/diegolnasc/gotcha/releases)---
## What can :robot: do?> *Gotcha*, is a app and works on fired events. For more details on a GitHub app, please check [here](https://docs.github.com/en/developers/apps/getting-started-with-apps/about-apps).
The main _Gotcha's_ features are:
- Ensure the **pull request** report (diff).
- Ensure the **pull request** name pattern is valid.
- Ensure the **pull request** labels are valid.
- Ensure the **pull request** assigners are valid.
- Ensure the **pull request** reviewers are valid.*Gotcha* implements the some of the features as a test suite. Therefore, adding a new functionality for validation is very simple and practical.
## Examples :eye_speech_bubble:
- **Pull Request Report**

- **Pull Request Test Validator**
Fail

---
Pass

## How to install
### GitHub app
First, go to your profile *Settings* → *Developer Settings*. Then create a GitHub app for *Gotcha* :smiley:.Fill in the necessary information to create the app.

> To test without hosting or exposing your application on the internet, a suggestion is to use https://smee.io
Next, enable the following permissions:
- Repository → Checks
- Repository → Issues
- Repository → Pull requests
- Repository → Contents
- Events → Check run
- Events → Issue comment
- Events → Issues
- Events → Pull request
- Events → Pull request review comment
- Events → Pull request review> It's worth noting that the permissions listed are *Gotcha's* default ones. If you are not interested in using some functionality or have another need, customize the permissions.
Finally, save the settings and "install" it in your profile.
Afterwards, generate a private key for the bot.### Gotcha Settings
In the *build* folder, you will find a file called **config.yaml** which is intended to configure some _Gotcha's_ features.
- In **Layout**, you'll find general *Gotcha* settings.
- In **GitHub**, you'll find general GitHub settings.**Layout**:
| Level | Description | Type | Default |
|--------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|----------------------------------------------------------------------------------------------------------------|
| administration → permission | Users who are allowed to execute commands such as pull request approval, test re-runs and others.
The permissions here are one level above the *repositories* item, so they overlap the others. | list(string) | None |
| administration → permission → repositories | Users with permissions on certain repositories. | list(object) | None |
| pullRequest → enableOverview | Enable pull request report (commits, diff, additions, deletes, extensions) overview. | bool | true |
| pullRequest → overViewCommand | Command to re-run the pull request overview. The _enableOverview_ must be true. | string | run overview |
| pullRequest → approveCommand | Command for approval of the PR by *Gotcha*. | string | lgtm |
| pullRequest → runTestSuiteCommand | Command to re-run the test suite. | string | run testsuite |
| pullRequest → mergeCommand | Command for merge of the PR by *Gotcha*. | string | merge |
| pullRequest → mergeAndDeleteCommand | Command for merge and delete ref branch of the PR by *Gotcha*. | string | merge and delete |
| pullRequest → testSuite → namePattern | Format (regex) that pull request name must follow.
Default value is based on [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/). | string(regex) | (?Pfeat|fix|refactor|style|docs|build|chore)(?P:) (?P.+)' |
| pullRequest → testSuite → reviewers | Need to have reviewers on the pull request. | bool | false |
| pullRequest → testSuite → assignees | Need to have assignees on the pull request. | bool | true |
| pullRequest → testSuite → labels | Need to have labels on the pull request. | bool | true |**Github**:
| Level | Description | Type | Default |
|--------------------|-----------------------------------------------------------|--------------|------------------------------------------------------------------------------------------------------|
| appId | GitHub App Id. | int | None(required) |
| organization | Name of the organization that *Gotcha* will be installed. | string | None |
| user | Name of the user that *Gotcha* will be installed. | string | None |
| webhookSecret | Webhook secret. | string | None(required) |
| privateKeyLocation | Private key location. | string | None |
| privateKey | Private key value. | string | None |
| events | List of events that *Gotcha* will listen to. | list(string) | issue
pull_request
pull_request_review_comment
pull_request_review
check_run |## Contributing
Gotcha is an open source bot made to facilitate developers' daily lives. Thus, all features are open to be modified and/or added.Please feel free to help!
For more details, see our guide.