Skip to content

joshdk/hub-comment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CircleCI License Github downloads GitHub release

Hub-Comment

πŸ“ Automate GitHub pull request comments in CI

Installing

From source

You can install a development version of this tool by running:

$ go get -u github.com/joshdk/hub-comment

Precompiled binary

Alternatively, you can download a precompiled release binary by running:

$ wget -q https://github.com/joshdk/hub-comment/releases/download/0.1.0/hub-comment_linux_amd64
$ sudo install hub-comment_linux_amd64 /usr/bin/hub-comment

Usage

Environment Setup

Since hub-comment communicates with the GitHub API, you must first create and export an API token into the working environment.

$ export GITHUB_TOKEN='2b6c...f4bd'

Comment Template

You can write a comment template file, using the same syntax used for Go templates. For example, you could save the following as hello-template.txt:

πŸ€– Hello from CI!

Build #{{.Env.CIRCLE_BUILD_NUM}} was run successfully.

Running

$ hub-comment -template-file hello-template.txt
Posting new comment as Josh Komoroske (joshdk) on joshdk/hub-comment#123:

β†’ πŸ€– Hello from CI!
β†’
β†’ Build #123 was run successfully.

To view comment visit:
β†’ https://github.com/joshdk/hub-comment/issues/123#issuecomment-421483151

License

This code is distributed under the MIT License, see LICENSE.txt for more information.