Sign inSign up

bottlecapdave/gitlab-merge-request-reminder

By bottlecapdave

•Updated about 3 years ago

Sends a reminder to slack for open merge requests on GitLab.

Image
0

50K+

bottlecapdave/gitlab-merge-request-reminder repository overview

⁠GitLab Merge Request Reminder

Docker Image Version (latest semver)

Sends a notification to a Slack webhook highlighting open merge requests for a given GitLab repository. If no merge requests are open, then no notification will be sent.

⁠Environment Variables

VariableDetailsExample Values
GITLAB_URLThe URL of the Gitlab server. Defaults to https://gitlab.comhttps://gitlab.company.com
GITLAB_ACCESS_TOKENThe access token for the GitLab repository. This needs at least read_api access and be done by following the Gitlab instructions⁠.
GITLAB_PROJECT_IDSThe GitLab project ids the merge requests are for. This should be comma separated (e.g. 12345,678910)12345,678910
INCLUDE_WIPDetermines if work in progress merge requests should be included. This is true by default.true or false
INCLUDE_DRAFTDetermines if draft merge requests should be included. This is true by default.true or false
GITLAB_MANDATORY_LABELSThe labels that merge requests must have assigned to them. All labels must be present. This should be comma separated (e.g. mandatory-label-1,mandatory-label-2)mandatory-label-1,mandatory-label-2
GITLAB_EXCLUDED_LABELSThe labels that merge requests must not have assigned to them. Any label must be present for the merge request to be ignored. This should be comma separated (e.g. excluded-label-1,excluded-label-2)excluded-label-1,excluded-label-2
SLACK_WEBHOOK_URLThe URL of the slack incoming webhook to send the notification to.
SLACK_TARGETThe target of the slack message. This is @here by default.@here

⁠Docker

This is available as a docker image, available on docker hub⁠.

⁠Example Uses

Because the logic is within a docker image, it can be run in a variety of places. Below I'll document examples of use.

⁠Gitlab Job

You could create a gitlab job which is run on a schedule⁠. For example

merge-request-reminder:
  stage: notify
  image: bottlecapdave/gitlab-merge-request-reminder:v1.5.0
  only:
    refs:
      - schedules
  script:
    - node /app/lib/index.js

⁠Build

You can run npm run docker-build to build a local docker image, which can then be run locally.

⁠Releases

To release a new version, merge into main. The github CI will then create a release based on the commitizen messages.

Tag summary

Content type

Image

Digest

sha256:eb20e77fe…

Size

85.9 MB

Last updated

about 3 years ago

docker pull bottlecapdave/gitlab-merge-request-reminder