Skip to content

Commit

Permalink
Merge pull request #116 from DeterminateSystems/env
Browse files Browse the repository at this point in the history
Support getting agent token from BUILDKITE_AGENT_TOKEN env var
  • Loading branch information
keithduncan authored Jul 16, 2021
2 parents 1d0ac29 + 6c40b47 commit c260bc1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,12 @@ func main() {
}

if *token == "" {
fmt.Println("Must provide a value for -token")
os.Exit(1)
if bkToken := os.Getenv("BUILDKITE_AGENT_TOKEN"); bkToken != "" {
*token = bkToken
} else {
fmt.Println("Must provide a token")
os.Exit(1)
}
}

var err error
Expand Down

0 comments on commit c260bc1

Please sign in to comment.