github-comment

CLI to create and hide GitHub comments

MIT License

Stars
88

Bot releases are hidden (Show)

github-comment - v2.1.0-1

Published by suzuki-shunsuke almost 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v2.1.0-0...v2.1.0-1
milestone

Fix

#193 fix: support to hide pull request comments

github-comment - v2.1.0-0

Published by suzuki-shunsuke almost 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v2.0.1...v2.1.0-0
milestone

Features

#187 #189 feat: support to hide existing comments
#190 feat: support --log-level option and structured logging with logrus

feat: support to hide existing comments

When github-comment is used at CI, github-comment posts a comment at every builds.
So many same comments would be posted.
Sometimes old comments are noisy, so we want to hide them.

By configuring minimize, we can hide existing comments.
minimize is an expr expression, and comments which match this condition would be hidden.

post:
  foo:
    template: foo
    minimize: Comment.Body contains "foo" # minimize existing comments which includes `foo`
exec:
  foo:
  - when: ExitCode != 0
    template: foo
    minimize: Comment.Body contains "foo" # minimize existing comments which includes `foo`

If minimize isn't set, no comment is hidden.

Wa can use HTML comment to hide comments.

post:
  foo:
    template: |
      {{"<!-- github-comment:foo-" | AvoidHTMLEscape}}{{env "TARGET"}}{{" -->" | AvoidHTMLEscape}}
      foo {{env "TARGET"}}
    minimize: |
      Comment.Body contains "<!-- github-comment:foo-" + Env("TARGET") + " -->"

In case of post command, we can use the following variables in minimize.

  • Commit:
    • Org
    • Repo
    • PRNumber
    • SHA1
  • Comment
    • Body
  • PostedComment:
    • Body
    • TemplateKey
  • Vars

In addition to above variables, we can use the following variables in case of exec command.

  • Command
    • ExitCode
    • Stdout
    • Stderr
    • CombinedOutput
    • Command
    • JoinCommand
github-comment - v2.0.1

Published by suzuki-shunsuke almost 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v2.0.0...v2.0.1
milestone

Fixes

#182 #183 fix: fix builtin template join_command and hidden_combined_output

Thanks to @yuya-takeyama #182

Problem to solve

If the content of .CombinedOutput is Markdown-like,
it will be parsed as markdown and the posted comment will be ugly.

TO BE

templates.join_command

If .JoinCommand includes ```,

<pre><code>$ {{.JoinCommand | AvoidHTMLEscape}}</pre></code>

Otherwise,

templates.hidden_combined_output

If .CombinedOutput includes ``` ,

<details><pre><code>{{.CombinedOutput | AvoidHTMLEscape}}</code></pre></details>

Otherwise,

github-comment - v2.0.1-0

Published by suzuki-shunsuke almost 4 years ago

Changelog

2c66d90 build: update version to v2.0.1-0

github-comment - v2.0.0

Published by suzuki-shunsuke almost 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v1.14.2...v2.0.0
milestone

#169 #170 fix: add the option -stdin-template to post command

BREAKING CHANGE: To read stdin as the template, we must specify the option -stdin-template

AS IS

echo hello | github-comment post

From v2.0.0, in case of the above command, the standard input will be ignored and the default template will be used.

TO BE

echo hello | github-comment post -stdin-template
github-comment - v1.14.2

Published by suzuki-shunsuke almost 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v1.14.1...v1.14.2
milestone

#160 #161 fix: the exit code of github-comment exec is different from the exit code of executed command

github-comment - v1.14.1

Published by suzuki-shunsuke almost 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v1.14.0...v1.14.1
milestone

#156 fix: define the template "link" always

github-comment - v1.14.0

Published by suzuki-shunsuke almost 4 years ago

github-comment - v1.14.0-0

Published by suzuki-shunsuke almost 4 years ago

Changelog

b985d55 build: update version to v1.14.0-0

github-comment - v1.13.0

Published by suzuki-shunsuke almost 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v1.12.1...v1.13.0
milestone

#149 feat: add a template function AvoidHTMLEscape

github-comment - v1.13.0-0

Published by suzuki-shunsuke almost 4 years ago

Changelog

5a7a150 build: update version to v1.13.0-0

github-comment - v1.12.1

Published by suzuki-shunsuke almost 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v1.12.0...v1.12.1
milestone

#147 fix: don't call fmt.Errorf if err is nil

github-comment - v1.12.0

Published by suzuki-shunsuke almost 4 years ago

github-comment - v1.11.2

Published by suzuki-shunsuke about 4 years ago

github-comment - v1.11.1

Published by suzuki-shunsuke about 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v1.11.0...v1.11.1
Milestone

#130 chore(deps): update module masterminds/sprig to v3

github-comment - v1.11.0

Published by suzuki-shunsuke about 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v1.10.0...v1.11.0
Milestone

#129 feat: add sprig as template functions
#131 fix: remove debug log
#132 feat: add the silent option

github-comment - v1.10.0

Published by suzuki-shunsuke about 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v1.9.0...v1.10.0
Milestone

#125 feat: post a substitute comment when it is failed to post a too long comment
#126 feat: add the configuration option skip_no_token

github-comment - v1.9.0

Published by suzuki-shunsuke about 4 years ago

github-comment - v1.8.1

Published by suzuki-shunsuke about 4 years ago

Changelog

https://github.com/suzuki-shunsuke/github-comment/compare/v1.8.0...v1.8.1
Milestone

#108 refactor: use go-ci-env
#109 #110

fix: failed to get SHA1 on Drone
ci: run dry run in CI for testing

github-comment - v1.8.0

Published by suzuki-shunsuke about 4 years ago

Package Rankings
Top 7.75% on Proxy.golang.org
Badges
Extracted from project README
Build Status Go Report Card GitHub last commit License