Permalink
Browse files

Rename GitHun API Token environment variable name

  • Loading branch information...
1 parent 68c0774 commit bc5b208d0049abf2e3f810bf6337d2f4feb7c63b @haya14busa committed Oct 23, 2016
Showing with 18 additions and 18 deletions.
  1. +1 −1 .drone.sec
  2. +2 −2 .drone.sec.sample.yaml
  3. +1 −1 .drone.yml
  4. +1 −1 .travis.yml
  5. +4 −4 cmd/reviewdog/main.go
  6. +7 −7 cmd/reviewdog/main_test.go
  7. +2 −2 github_test.go
View
@@ -1 +1 @@
-eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.GVCyMNII0AoQKyoZuVoy90AR5hhc5qKNDK8GEjaLS2xo1Kx3saLnkryg8DuOCE-Avf0O62toDYD0VIgXi6mtN5flf0JLAYdV_A6DZXfim3RVVzTBmHwVeeYwSt1K4TcOi_AT5iuXDLPj9Af87xdB7FMAvFr9hqOiCqA1_Oa2Zn-9BtzYVto_SXwrmPxM0K0pYw8M08rN1qAgM34ctV1HodoI-9Z8_Sy4HLwkCmAE42oZp93Tw3UdGtibTK1cRUg45Kw574iBUA8VzMYxwLDRJxqU3Yzat4Hbq8YL_SZJ8E0mr9rtCn3Bf3vL6NWAhH7WYH7E4NiX82_89jYEC6NcXg.IzYIlskP4oPmgS-D.65E_gjqBTQTDfNmD-mIsDSlvAspuyxcqeXj7eONaNQf0dNxXxeyPr40gX75jrSXEMySlhteJF-hO3ElwEV3vU_QXl49Yz2xr-1_1ltbOaWEjNhb3rLPNFtvsh-Ljjb9epIK2z9mWQ2m_Ss4LIKfZgJNd--tusHg0Gm3CpLui-rv8brrDKsySi1JMYP5H5hSpVJzPy3kLFXR5oW9b0Ewa.VVVMl0PAa978pZoj1iBEQA
+eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.fAZ6LxRZewBXNHzD3jeGVYUbJ0fHfqLzyUefVFUuOqvA84sPolMaT1OltFqBM4bv8TEGX42EDG8JHr6A8EqUuPT4JdfTpZfSNyNhv9Zq9r5qu4Gz1ARJ-gsBHLJiYvZtu-K9ZoIr_BYYE8gWZYmwsFgC5pNiWCOCqDPfTV6N3i4VCKK3AGMkz0ycu_qMG7pZu7KtC-7P-iEeuAPt9Ej4jmnB_T9kI9lJEvFBCx5N8fu_dINcPO82JqE0EdNFSYtBP1S8No1hJVcnG_rBhvDc_1PIacHQ3hb-fWT3glawgNXtU2BDF3ho0KHTdYrN-R0Mw2s8do5ggsjLbUdyt84DQg.wnhJ6z3O9aC4uZhM.gtEQnNUIqUf4IBPMzsz1BdjPi0BOFhlF-UwjLnoYAKFHLKg24wvbuATsnAIArRYNB8CWN1eekExWW3i2O4NF9JYwdU9SMOAQLCHP7epu3PjmgyFHIE2GN_naHwYlwKKMRfN0q_Y06HNNUTxkQIDl5rBYsaoc9vG0XVZ7kubcLDtKoTofwe4Nwz_CAo6b99KUn50XoVBpQfZ88-Ukyqdp.xC6nUFrWaCX5TYr7IhOarg
@@ -1,4 +1,4 @@
-# copy this file to .drone.sec.yaml and insert <WATCHDOGS_GITHUB_API_TOKEN>
+# copy this file to .drone.sec.yaml and insert <REVIEWDOG_GITHUB_API_TOKEN>
# cp .drone.sec.sample.yaml .drone.sec.yaml
environment:
- WATCHDOGS_GITHUB_API_TOKEN: <WATCHDOGS_GITHUB_API_TOKEN>
+ REVIEWDOG_GITHUB_API_TOKEN: <REVIEWDOG_GITHUB_API_TOKEN>
View
@@ -10,7 +10,7 @@ build:
lint:
image: golang
environment:
- - WATCHDOGS_GITHUB_API_TOKEN=$$WATCHDOGS_GITHUB_API_TOKEN
+ - REVIEWDOG_GITHUB_API_TOKEN=$$REVIEWDOG_GITHUB_API_TOKEN
commands:
- go get github.com/haya14busa/reviewdog/cmd/reviewdog
- go get github.com/golang/lint/golint
View
@@ -6,7 +6,7 @@ go:
env:
global:
- - secure: "CZlsRUQQjxx9XlMZT2GIpOFJiwGkvlF502UhvrlJuB+TCDJI0G5I1s5tkLVl2Sq+rG7jLwi//x97MbSAr/IW8xi4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1Qg5AF2nEfV7EkAv/hGGDoctm5JEoegu0t5wZdU1KPUIjGLMDUD3Z/nMPkWTVfoYVTDdfTUrwqzixYDO61CgDy5zbz/FsYVWB5JVCK4mT3XcK5n2YY3KXRlIkxgfFA6XDaXEc3OBGvdJotvTG23ZWFV/K4KSGYqMagITDnXzY/pEYaBK1UiLH/AMIYDlS6wcfE5w="
before_script:
- echo $TRAVIS
@@ -36,7 +36,7 @@ var (
ci string
ciDoc = `CI service (supported travis, circle-ci, droneio(OSS 0.4), common)
- If you use "ci" flag, you need to set WATCHDOGS_GITHUB_API_TOKEN environment
+ If you use "ci" flag, you need to set REVIEWDOG_GITHUB_API_TOKEN environment
variable. Go to https://github.com/settings/tokens and create new Personal
access token with repo scope.
@@ -81,7 +81,7 @@ func run(r io.Reader, w io.Writer, diffCmd string, diffStrip int, efms []string,
var ds reviewdog.DiffService
if ci != "" {
- if os.Getenv("WATCHDOGS_GITHUB_API_TOKEN") != "" {
+ if os.Getenv("REVIEWDOG_GITHUB_API_TOKEN") != "" {
gs, isPR, err := githubService(ci)
if err != nil {
return err
@@ -93,7 +93,7 @@ func run(r io.Reader, w io.Writer, diffCmd string, diffStrip int, efms []string,
cs = gs
ds = gs
} else {
- fmt.Fprintf(os.Stderr, "WATCHDOGS_GITHUB_API_TOKEN is not set\n")
+ fmt.Fprintf(os.Stderr, "REVIEWDOG_GITHUB_API_TOKEN is not set\n")
return nil
}
} else {
@@ -149,7 +149,7 @@ func diffService(s string, strip int) (reviewdog.DiffService, error) {
}
func githubService(ci string) (githubservice *reviewdog.GitHubPullRequest, isPR bool, err error) {
- token, err := nonEmptyEnv("WATCHDOGS_GITHUB_API_TOKEN")
+ token, err := nonEmptyEnv("REVIEWDOG_GITHUB_API_TOKEN")
if err != nil {
return nil, false, err
}
@@ -10,7 +10,7 @@ import (
func TestRun_travis(t *testing.T) {
envs := []string{
- "WATCHDOGS_GITHUB_API_TOKEN",
+ "REVIEWDOG_GITHUB_API_TOKEN",
"TRAVIS_PULL_REQUEST",
"TRAVIS_REPO_SLUG",
"TRAVIS_PULL_REQUEST_SHA",
@@ -32,7 +32,7 @@ func TestRun_travis(t *testing.T) {
t.Errorf("got an unexpected error: %v", err)
}
- os.Setenv("WATCHDOGS_GITHUB_API_TOKEN", "<WATCHDOGS_GITHUB_API_TOKEN>")
+ os.Setenv("REVIEWDOG_GITHUB_API_TOKEN", "<REVIEWDOG_GITHUB_API_TOKEN>")
if err := run(nil, nil, "", 0, nil, "unsupported ci"); err == nil {
t.Error("error expected but got nil")
@@ -105,7 +105,7 @@ func TestCircleci(t *testing.T) {
"CIRCLE_PROJECT_USERNAME",
"CIRCLE_PROJECT_REPONAME",
"CIRCLE_SHA1",
- "WATCHDOGS_GITHUB_API_TOKEN",
+ "REVIEWDOG_GITHUB_API_TOKEN",
}
// save and clean
saveEnvs := make(map[string]string)
@@ -178,7 +178,7 @@ func TestCircleci(t *testing.T) {
t.Errorf("got: %#v, want: %#v", g, want)
}
- os.Setenv("WATCHDOGS_GITHUB_API_TOKEN", "<WATCHDOGS_GITHUB_API_TOKEN>")
+ os.Setenv("REVIEWDOG_GITHUB_API_TOKEN", "<REVIEWDOG_GITHUB_API_TOKEN>")
if err := run(strings.NewReader("compiler result"), new(bytes.Buffer), "", 0, nil, "circle-ci"); err == nil {
t.Error("error expected but got nil")
} else {
@@ -191,7 +191,7 @@ func TestDroneio(t *testing.T) {
"DRONE_PULL_REQUEST",
"DRONE_REPO",
"DRONE_COMMIT",
- "WATCHDOGS_GITHUB_API_TOKEN",
+ "REVIEWDOG_GITHUB_API_TOKEN",
}
// save and clean
saveEnvs := make(map[string]string)
@@ -256,7 +256,7 @@ func TestDroneio(t *testing.T) {
t.Errorf("got: %#v, want: %#v", g, want)
}
- os.Setenv("WATCHDOGS_GITHUB_API_TOKEN", "<WATCHDOGS_GITHUB_API_TOKEN>")
+ os.Setenv("REVIEWDOG_GITHUB_API_TOKEN", "<REVIEWDOG_GITHUB_API_TOKEN>")
if err := run(strings.NewReader("compiler result"), new(bytes.Buffer), "", 0, nil, "droneio"); err == nil {
t.Error("error expected but got nil")
} else {
@@ -270,7 +270,7 @@ func TestCommonci(t *testing.T) {
"CI_COMMIT",
"CI_REPO_OWNER",
"CI_REPO_NAME",
- "WATCHDOGS_GITHUB_API_TOKEN",
+ "REVIEWDOG_GITHUB_API_TOKEN",
}
// save and clean
saveEnvs := make(map[string]string)
View
@@ -8,10 +8,10 @@ import (
"golang.org/x/oauth2"
)
-const notokenSkipTestMes = "skipping test (requires actual Personal access tokens. export WATCHDOGS_TEST_GITHUB_API_TOKEN=<GitHub Personal Access Token>)"
+const notokenSkipTestMes = "skipping test (requires actual Personal access tokens. export REVIEWDOG_TEST_GITHUB_API_TOKEN=<GitHub Personal Access Token>)"
func setupGitHubClient() *github.Client {
- token := os.Getenv("WATCHDOGS_TEST_GITHUB_API_TOKEN")
+ token := os.Getenv("REVIEWDOG_TEST_GITHUB_API_TOKEN")
if token == "" {
return nil
}

0 comments on commit bc5b208

Please sign in to comment.