github-comment-cli

module
v0.1.0-2 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: MIT

README

github-comment-cli

Build Status codecov Go Report Card GitHub last commit License

CLI to create a GitHub comment with GitHub REST API

Usage

$ github-comment -version
$ github-comment -help
# comment to a commit
$ github-comment  [-token <token>] [-org <org>] [-repo <repo>] [-revision <revision>] [-template <template>]
# comment to a pull request
$ github-comment  [-token <token>] [-org <org>] [-repo <repo>] [-pr <pr number>] [-template <template>]
$ echo "<comment>" | github-comment  [-token <token>] [-org <org>] [-repo <repo>] [-pr <pr number>]

Options

  • token: GitHub API token to create a comment
  • org: GitHub organization name
  • repo: GitHub repository name
  • revision: commit SHA
  • pr: pull request number
  • template: comment text

Support standard input to pass a template

Instead of -template, we can pass a template from a standard input.

$ echo hello | github-comment

Environment variables

  • GITHUB_TOKEN: complement the option token

Support to complement options with CircleCI built-in Environment variables

https://circleci.com/docs/2.0/env-vars/#built-in-environment-variables

  • org: CIRCLE_PROJECT_USERNAME
  • repo: CIRCLE_PROJECT_REPONAME
  • pr: CIRCLE_PULL_REQUEST
  • revision: CIRCLE_SHA

License

MIT

Directories

Path Synopsis
cmd
github-comment command
pkg

Jump to

Keyboard shortcuts

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