mirror of
https://github.com/actions/actions-runner-controller.git
synced 2025-12-10 03:13:15 +00:00
Improve error message
This commit is contained in:
5
main.go
5
main.go
@@ -18,8 +18,8 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/google/go-github/v29/github"
|
||||
@@ -56,8 +56,7 @@ func main() {
|
||||
|
||||
ghToken := os.Getenv("GITHUB_TOKEN")
|
||||
if ghToken == "" {
|
||||
err := errors.New("github token is not specified")
|
||||
setupLog.Error(err, "environment variable 'GITHUB_TOKEN' must be set")
|
||||
fmt.Fprintln(os.Stderr, "Error: access token is not specified in the environment variable 'GITHUB_TOKEN'")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user