flag.StringVar(&webhookAddr,"webhook-addr",":8000","The address the metric endpoint binds to.")
flag.StringVar(&metricsAddr,"metrics-addr",":8080","The address the metric endpoint binds to.")
flag.StringVar(&logLevel,"log-level",logging.LogLevelDebug,`The verbosity of the logging. Valid values are "debug", "info", "warn", "error". Defaults to "debug".`)
flag.StringVar(&webhookSecretToken,"github-webhook-secret-token","","The personal access token of GitHub.")
flag.StringVar(&c.Token,"github-token",c.Token,"The personal access token of GitHub.")
flag.Int64Var(&c.AppID,"github-app-id",c.AppID,"The application ID of GitHub App.")
flag.Int64Var(&c.AppInstallationID,"github-app-installation-id",c.AppInstallationID,"The installation ID of GitHub App.")
flag.StringVar(&c.AppPrivateKey,"github-app-private-key",c.AppPrivateKey,"The path of a private key file to authenticate as a GitHub App")
flag.StringVar(&c.URL,"github-url",c.URL,"GitHub URL to be used for GitHub API calls")
flag.StringVar(&c.UploadURL,"github-upload-url",c.UploadURL,"GitHub Upload URL to be used for GitHub API calls")
flag.StringVar(&c.BasicauthUsername,"github-basicauth-username",c.BasicauthUsername,"Username for GitHub basic auth to use instead of PAT or GitHub APP in case it's running behind a proxy API")
flag.StringVar(&c.BasicauthPassword,"github-basicauth-password",c.BasicauthPassword,"Password for GitHub basic auth to use instead of PAT or GitHub APP in case it's running behind a proxy API")
flag.StringVar(&c.RunnerGitHubURL,"runner-github-url",c.RunnerGitHubURL,"GitHub URL to be used by runners during registration")
flag.StringVar(&logFormat,"log-format","text",`The log format. Valid options are "text" and "json". Defaults to "text"`)
logger.Info(fmt.Sprintf("Using the value from %s for -github-webhook-secret-token",webhookSecretTokenEnvName))
webhookSecretToken=webhookSecretTokenEnv
}
ifwebhookSecretToken==""{
logger.Info(fmt.Sprintf("-github-webhook-secret-token and %s are missing or empty. Create one following https://docs.github.com/en/developers/webhooks-and-events/securing-your-webhooks and specify it via the flag or the envvar",webhookSecretTokenEnvName))
}
ctrl.SetLogger(logger)
// Valid GitHub API credentials is required to call get workflow job logs
logger.Error(err,"unable to create controller","controller","Runner")
os.Exit(1)
}
}else{
logger.Info("GitHub client is not initialized. Runner groups with custom visibility are not supported. If needed, please provide GitHub authentication. This will incur in extra GitHub API calls")