mirror of
https://github.com/swisscom/renovate-approve-bot-bitbucket-server.git
synced 2026-12-04 16:28:48 +00:00
Bot to automatically approve Bitbucket Server PRs | Read-only mirror of https://github.com/swisscom/renovate-approve-bot-bitbucket-server — Swisscom. Issues & pull requests at the source.
- Go 78.9%
- Makefile 15.1%
- Dockerfile 4.1%
- Shell 1.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .dockerignore | ||
| .gitignore | ||
| Dockerfile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| Makefile | ||
| README.md | ||
| version.sh | ||
renovate-approve-bot-bitbucket-server
Introduction
This is a small application, similar to renovatebot/renovate-approve-bot-bitbucket-cloud to automatically approve PRs where the current user is added as a reviewer.
The idea behind this tool is to be able to auto-approve PRs from Renovate
so that, if they have automerge enabled they can be automerged by Renovate itself.
This tool doesn't automatically merge any PR, it just approves them.
Requirements
- Docker
- Make
Building
Docker Image
make REGISTRY= IMAGE=your-username/bb-approve-bot docker-build
make REGISTRY= IMAGE=your-username/bb-approve-bot docker-run
Warning: the default configuration assumes one of our internal Docker registries
Locally
make build
./approve-bot
Usage
Usage: approve-bot [--debug] --username USERNAME --password PASSWORD --endpoint ENDPOINT [--author-filter AUTHOR-FILTER]
Options:
--debug, -D
--username USERNAME, -u USERNAME [env: BITBUCKET_USERNAME]
--password PASSWORD, -p PASSWORD [env: BITBUCKET_PASSWORD]
--endpoint ENDPOINT, -e ENDPOINT [env: BITBUCKET_ENDPOINT]
--author-filter AUTHOR-FILTER, -a AUTHOR-FILTER [env: BITBUCKET_AUTHOR_FILTER]
--add-comment, -c "true" to add a comment in addition to approving a PR, "false" to not add a comment. [default: true, env: BITBUCKET_ADD_COMMENT]
--help, -h display this help and exit
Quick Local Run
export BITBUCKET_USERNAME=your-username
read -s -r BITBUCKET_PASSWORD
# Type password and press enter
export BITBUCKET_PASSWORD
export BITBUCKET_ENDPOINT=https://bitbucket.example.com/rest
export BITBUCKET_AUTHOR_FILTER=renovate-bot # Only approve PRs created by this user
export BITBUCKET_ADD_COMMENT=true
make REGISTRY= IMAGE=your-username/bb-approve-bot docker-run