Skip to content

About gitlab-comment is a CLI command to post Merge Request Note.

License

Notifications You must be signed in to change notification settings

yuyaban/gitlab-comment

Repository files navigation

gitlab-comment

Build Status Go Report Card GitHub last commit License

CLI to create GitLab Notes by GitLab REST API
Fork of suzuki-shunsuke/github-comment, supporting GitLab (dropped GitHub support).

Document

Prerequisites

  • Create and store GitLab access token in project or group CI variables with key name GITLAB_TOKEN or GITLAB_ACCESS_TOKEN.
    ref: Project access tokens | GitLab
  • When using the post command, a default template is not provided, so you must provide configuration file.
    The configuration file name must be one of the following.
    • .gitlab-comment.yml (or gitlab-comment.yml)
    • .gitlab-comment.yaml (or gitlab-comment.yaml)

Basic Comamnds are follows:

# post
github-comment post -k hello
# post: Enable updateCondition
github-comment post -k hello -u 'Comment.HasMeta && Comment.Meta.TemplateKey == "hello"' --var target:"${CI_JOB_NAME}"

# exec
github-comment exec -k hello -- echo "this is comment"
# exec: Enable updateCondition
github-comment exec -k hello -u 'Comment.HasMeta && Comment.Meta.TemplateKey == "hello"' --var target:"${CI_JOB_NAME}" -- echo "this is comment"

A concrete example of gitlab-comment configuration running on GitLab CI can be found in .gitlab-ci.yml.

And, See also the original documentation (suzuki-shunsuke/github-comment).

License

MIT

About

About gitlab-comment is a CLI command to post Merge Request Note.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published