Shell script using curl and Gitlab CI Variables to post messages on Merge Requests
See the .gitlab-ci.yml for the example and the execution
The script looks for the following variables:
TOKEN
: API Token, see Personal access tokens or Project access tokensCI_API_V4_URL
: API URL, always available on Gitlab Pipelines, see Predefined variables referenceCI_PROJECT_ID
: Unique id of the project, see Predefined variables referenceCI_MERGE_REQUEST_IID
orCI_OPEN_MERGE_REQUESTS
: Variable for Merge Request ID, see Predefined variables reference or Predefined variables for merge request pipelinesCOMMENT_MSG
: Message to post on MR
cd src/ && ./notifier.sh
You can run using the docker image available on Docker Hub or GHCR
docker run -e TOKEN=<TOkEN> -e CI_API_V4_URL=<URL> -e CI_PROJECT_ID=<ProjectID> -e CI_MERGE_REQUEST_IID=<MRID> -e COMMENT_MSG=<YourMessage> ferrgo/gitlab-ci-notifier
Publishing to Docker Hub @ ferrgo/gitlab-ci-notifier
Publishing to Github Pkgs @ docker.pkg.github.com/ferrgo/gitlab-ci-notifier/gitlab-ci-notifier
Publishing to Github Container Registry @ ghcr.io/ferrgo/curlybox