Skip to content

Commit

Permalink
Allow Github Token to be provided via environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo committed Aug 25, 2022
1 parent 0782176 commit 2f47e48
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/GitHub/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ public function read(): string
return $this->token;
}

// Allow the token to be provided via an environment variable
if (!empty($_SERVER['WINTER_CLI_GITHUB_TOKEN'])) {
return $this->token = $_SERVER['WINTER_CLI_GITHUB_TOKEN'];
}
if (!empty($_ENV['WINTER_CLI_GITHUB_TOKEN'])) {
return $this->token = $_ENV['WINTER_CLI_GITHUB_TOKEN'];
}

$dataDir = new DataDir();
$token = $dataDir->exists($this->tokenFile);

Expand Down

0 comments on commit 2f47e48

Please sign in to comment.