yuyaban / gitlab-comment

About gitlab-comment is a CLI command to post Merge Request Note.
Other
14 stars 2 forks source link

Feat/update comment #5

Closed yuyaban closed 1 year ago

yuyaban commented 1 year ago

Description

Two functions have been added.

Test Case

Post

$ HELLO=test1 go run ./cmd/gitlab-comment post --org yuyaban --repo gitlab-comment --mr 1 -k hello -u 'Comment.HasMeta && Comment.Meta.TemplateKey == "hello"' --var target:"JOB_A"
$ HELLO=test2 go run ./cmd/gitlab-comment post --org yuyaban --repo gitlab-comment --mr 1 -k hello -u 'Comment.HasMeta && Comment.Meta.TemplateKey == "hello"' --var target:"JOB_A"
$ HELLO=test1 go run ./cmd/gitlab-comment post --org yuyaban --repo gitlab-comment --mr 1 -k hello -u 'Comment.HasMeta && Comment.Meta.TemplateKey == "hello"' --var target:"JOB_B"

Exec

$ go run ./cmd/gitlab-comment exec --org yuyaban --repo gitlab-comment --mr 1 -k hello -u 'Comment.HasMeta && Comment.Meta.TemplateKey == "hello"' --var target:"JOB_A" -- echo "test comment test1" 
$ go run ./cmd/gitlab-comment exec --org yuyaban --repo gitlab-comment --mr 1 -k hello -u 'Comment.HasMeta && Comment.Meta.TemplateKey == "hello"' --var target:"JOB_A" -- echo "test comment test2"
$ go run ./cmd/gitlab-comment exec --org yuyaban --repo gitlab-comment --mr 1 -k hello -u 'Comment.HasMeta && Comment.Meta.TemplateKey == "hello"' --var target:"JOB_B" -- echo "test comment test1"