Sign inSign up

brpaz/gitlab-mr-commenter

By brpaz

•Updated over 7 years ago

Create comments (notes) on a GitLab merge request.

Image
0

291

brpaz/gitlab-mr-commenter repository overview

⁠GitLab Merge Request Commenter

Tool to create comments on GitLab⁠ merge requests.

pipeline status Docker Hub Go Report Card License MIT

⁠Usage

To be able to run this command you need to pass some configuration variables to it. There are two ways you can do it: Via command line flags or with enviornment variables.

docker run --rm brpaz/gitlab-mr-commenter \
-e GITLAB_MR_COMMENTER_ACCESS_TOKEN=<token> \
-e GITLAB_MR_COMMENTER_PROJECT_ID=<project_id> \
-e GITLAB_MR_COMMENTER_MR_ID=<gitlab-mr-id> \
-e GITLAB_MR_COMMENTER_MR_COMMENT_CONTENT=<comment-content>
docker run --rm brpaz/gitlab-mr-commenter --access-token=<token> --project-id=<project_id> --mr-id=<mr-id> <comment_content>
  • You can get your Access token in this⁠ page.
  • The project id you can get it in your project page on GitLab and the Merge request ID from the url of your merge request.

By default it will try to connect to the GitLab hosted version API at (https://gitlab.com/api/v4⁠). If you want to use this in a self hosted GitLab, you can override this setting using the Environment variable "GITLAB_MR_COMMENTER_API_URL" or using the command line flag "api-url".

⁠Development

If you want to develop locally you need to have go > 1.11 installed with "go modules" support enabled. Alternatively you can use Docker and Docker-compose.

A makefile is provided with common tasks.

⁠Develop Locally
make build
 ./build/gitlab-mr-commenter

If you want to use environment variables to configure the command, an .env.dist file is provided. You can load your variables into your terminal session using the following commands:

cp .env.dist .env
export $(egrep -v '^#' .env | xargs)
⁠Develop with Docker Compose

make run-compose

⁠Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

⁠Authors

⁠License

MIT⁠

Tag summary

Content type

Image

Digest

Size

9.3 MB

Last updated

over 7 years ago

docker pull brpaz/gitlab-mr-commenter