gitlab-comment

module
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2024 License: MIT

README

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

Directories

Path Synopsis
cmd
pkg
api
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL