From 5af1e9f51a97d8ff5be15ff39a9aa7479f3c495f Mon Sep 17 00:00:00 2001 From: niuhuan Date: Thu, 7 Apr 2022 21:47:36 +0800 Subject: [PATCH] update token --- ci/cmd/check_asset/main.go | 4 ++-- ci/cmd/upload_asset/main.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ci/cmd/check_asset/main.go b/ci/cmd/check_asset/main.go index b523c1d..41b30b0 100644 --- a/ci/cmd/check_asset/main.go +++ b/ci/cmd/check_asset/main.go @@ -35,7 +35,7 @@ func main() { version.Info = strings.TrimSpace(string(infoFile)) // get target target := os.Getenv("TARGET") - if ghToken == "" { + if target == "" { println("Env ${TARGET} is not set") os.Exit(1) } @@ -67,7 +67,7 @@ func main() { panic(err) } getReleaseRequest.Header.Set("User-Agent", ua) - getReleaseRequest.Header.Set("Authorization", ghToken) + getReleaseRequest.Header.Set("Authorization", "token "+ghToken) getReleaseResponse, err := http.DefaultClient.Do(getReleaseRequest) if err != nil { panic(err) diff --git a/ci/cmd/upload_asset/main.go b/ci/cmd/upload_asset/main.go index d6a7014..050660b 100644 --- a/ci/cmd/upload_asset/main.go +++ b/ci/cmd/upload_asset/main.go @@ -36,7 +36,7 @@ func main() { version.Info = strings.TrimSpace(string(infoFile)) // get target target := os.Getenv("TARGET") - if ghToken == "" { + if target == "" { println("Env ${TARGET} is not set") os.Exit(1) } @@ -91,7 +91,7 @@ func main() { panic(err) } getReleaseRequest.Header.Set("User-Agent", ua) - getReleaseRequest.Header.Set("Authorization", ghToken) + getReleaseRequest.Header.Set("Authorization", "token "+ghToken) getReleaseResponse, err := http.DefaultClient.Do(getReleaseRequest) if err != nil { panic(err) @@ -121,7 +121,7 @@ func main() { panic(err) } uploadRequest.Header.Set("User-Agent", ua) - uploadRequest.Header.Set("Authorization", ghToken) + uploadRequest.Header.Set("Authorization", "token "+ghToken) uploadRequest.Header.Set("Content-Type", contentType) uploadRequest.ContentLength = contentLength uploadResponse, err := http.DefaultClient.Do(uploadRequest)