Skip to content
This repository has been archived by the owner on Jul 26, 2020. It is now read-only.

Commit

Permalink
Add API key option for use in CI (#14)
Browse files Browse the repository at this point in the history
* Add API key option for use in CI
* Enable test job in CI
* Build requires test
* Disable lint
  • Loading branch information
jmickey committed May 17, 2019
1 parent a38bed5 commit bc137f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
workflows:
lint_and_build:
jobs:
- lint
# - test
- build
# requires:
# - test
# - lint
- test
- build:
requires:
- test
7 changes: 7 additions & 0 deletions providers/youtube.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"golang.org/x/oauth2/google"
"gopkg.in/yaml.v2"

"google.golang.org/api/googleapi/transport"
"google.golang.org/api/youtube/v3"
)

Expand Down Expand Up @@ -302,6 +303,12 @@ https://developers.google.com/api-client-library/python/guide/aaa_client_secrets
// getClient uses a Context and Config to retrieve a Token
// then generate a Client. It returns the generated Client.
func getClient(scope string) *http.Client {
if apiKey := os.Getenv("YOUTUBE_API"); apiKey != "" {
return &http.Client{
Transport: &transport.APIKey{Key: apiKey},
}
}

ctx := context.Background()

b := []byte(accessJSON)
Expand Down

0 comments on commit bc137f6

Please sign in to comment.