Skip to content

Commit

Permalink
Ensure Owner Or Organization Present
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Udit committed Jul 31, 2020
1 parent 4f1a7ea commit eee8ea8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion github/provider_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,23 @@ func testAccPreCheck(t *testing.T) {
}

func testAccCheckOrganization() error {

baseURL := os.Getenv("GITHUB_BASE_URL")
token := os.Getenv("GITHUB_TOKEN")

owner := os.Getenv("GITHUB_OWNER")
if owner == "" {
organization := os.Getenv("GITHUB_ORGANIZATION")
if organization == "" {
return fmt.Errorf("Neither `GITHUB_OWNER` or `GITHUB_ORGANIZATION` set in environment")
}
owner = organization
}

config := Config{
BaseURL: baseURL,
Token: token,
Owner: testOwner,
Owner: owner,
}

meta, err := config.Meta()
Expand Down

0 comments on commit eee8ea8

Please sign in to comment.