Merge pull request #18 from github/gracefully-fail-if-token-envvar-unset
cmd/ghcs/main: Fail gracefully if `GITHUB_TOKEN` entirely unset
This commit is contained in:
commit
f7e32485fc
1 changed files with 5 additions and 0 deletions
|
|
@ -22,6 +22,11 @@ var rootCmd = &cobra.Command{
|
|||
}
|
||||
|
||||
func Execute() {
|
||||
if os.Getenv("GITHUB_TOKEN") == "" {
|
||||
fmt.Println("The GITHUB_TOKEN environment variable is required. Create a Personal Access Token with org SSO access at https://github.com/settings/tokens/new.")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue