项目作者: McKael

项目描述 :
Github repository CLI Release Checker
高级语言: Go
项目地址: git://github.com/McKael/ghreleasechecker.git
创建时间: 2018-04-01T19:44:10Z
项目社区:https://github.com/McKael/ghreleasechecker

开源协议:MIT License

下载


gh_release_checker

ghReleaseChecker is a small CLI utility that uses the Github API to
periodically check a list of projects for new releases.

license
Build Status
Go Report Card

Installation

Pre-built binaries of the command line utility are available from the
Release page.

It can also be built from source and installed with the usual command:

  1. go get -u github.com/McKael/ghreleasechecker

Builds are tested with Travis for Go versions 1.7+.

Usage

By default, ghReleaseChecker outputs the new versions to stdout, which might be
suitable for a cron job, but it is possible to use a simple (Go) template or a
JSON/YAML format that can be used for automation.

A YAML configuration file is required; you can find a sample in the repository
root directory.

ghReleaseChecker uses a JSON state file, which path should be defined in the
configuration file.

Here’s a sample use case:

  1. % ghreleasechecker --config ./ghreleasechecker.yaml -o plain
  2. New release for kubernetes/kubernetes: v1.10.0
  3. Tag: v1.10.0
  4. Date: 2018-03-27 01:57:17 +0200 CEST
  5. New release for BurntSushi/ripgrep: 0.8.1
  6. Tag: 0.8.1
  7. Date: 2018-02-21 03:11:44 +0100 CET
  8. New release for restic/restic: restic 0.8.3
  9. Tag: v0.8.3
  10. Date: 2018-02-26 21:41:52 +0100 CET

The output can be customized with templates, here’s an example with the
default configuration file:

  1. % ghreleasechecker --config ghreleasechecker.yaml
  2. McKael/ghreleasechecker ghReleaseChecker 0.0.1 -- Initial release v0.0.1 2018-04-02 00:06:03 +0200 CEST
  3. kubernetes/kubernetes v1.10.0 v1.10.0 2018-03-27 01:57:17 +0200 CEST
  4. BurntSushi/ripgrep 0.8.1 0.8.1 2018-02-21 03:11:44 +0100 CET
  5. restic/restic restic 0.8.3 v0.8.3 2018-02-26 21:41:52 +0100 CET

Colors can be used on terminals supporting ANSI sequences.

Screenshot

Please check the commented YAML sample configuration file
provided with the source code for the details and the online help for CLI usage,
available with the --help flag:

  1. % ghreleasechecker --help
  2. ghReleaseChecker is a release watcher for Github projects.
  3. (...)
  4. Usage:
  5. ghreleasechecker [flags]
  6. Flags:
  7. --color string Color mode (auto|on|off; for output=template)
  8. --config string config file (default is $HOME/.config/ghreleasechecker/ghreleasechecker.yaml)
  9. --debug Display debugging details
  10. -h, --help help for ghreleasechecker
  11. -o, --output string Output handler (default: plain)
  12. --read-only Do not update the state file
  13. --show-body Display release body (for output=plain)
  14. --template string Go template (for output=template)
  15. -t, --token string Github API user token
  16. --version Display version
  17. --wait Wait when rate limit is exceeded