Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Checking for GH Token env
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickLaabs committed Feb 21, 2024
1 parent 4149b9f commit 3efcc7e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/frigg/bootstrap/capd/cluster/cluster.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cluster

import (
"fmt"
"github.com/PatrickLaabs/frigg/cmd/frigg/bootstrap/capd/clusterapi"
"github.com/PatrickLaabs/frigg/cmd/frigg/bootstrap/capd/helmchartproxies"
"github.com/PatrickLaabs/frigg/internal/runtime"
Expand Down Expand Up @@ -93,6 +94,17 @@ func NewCommand(logger log.Logger, streams cmd.IOStreams) *cobra.Command {
}

func runE(logger log.Logger, streams cmd.IOStreams, flags *flagpole) error {

// Get GITHUB_TOKEN environment var
if os.Getenv("GITHUB_TOKEN") == "" {
fmt.Println("Missing Github Token, please set it. Exiting now.")
os.Exit(1)
} else {
os.Getenv("GITHUB_TOKEN")
fmt.Printf("Github Token:%v\n", os.Getenv("GITHUB_TOKEN"))
}

// Create working directory for frigg $HOME/.frigg
workdir.CreateDir()
provider := cluster.NewProvider(
cluster.ProviderWithLogger(logger),
Expand Down

0 comments on commit 3efcc7e

Please sign in to comment.