mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
fix api breaking of google/go-github
google/go-github broke the api of their functions with 23d6cb9cac
This commit adds the context `context.TODO()` to the call of `gh.Repositories.ListReleases` which is meant to be used "when it's unclear which Context to use or it is not yet available (because the surrounding function has not yet been extended to accept a Context parameter)" (citing https://godoc.org/context)
Signed-off-by: julian <dev@jneureuther.de>
This commit is contained in:
parent
ce596b810d
commit
245a033456
@ -10,6 +10,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
"context"
|
||||||
|
|
||||||
"github.com/google/go-github/github"
|
"github.com/google/go-github/github"
|
||||||
)
|
)
|
||||||
@ -96,7 +97,7 @@ func findAsset(release *github.RepositoryRelease) *github.ReleaseAsset {
|
|||||||
func CheckUpdate(version string) error {
|
func CheckUpdate(version string) error {
|
||||||
// fetch releases
|
// fetch releases
|
||||||
gh := github.NewClient(nil)
|
gh := github.NewClient(nil)
|
||||||
releases, _, err := gh.Repositories.ListReleases("ansible-semaphore", "semaphore", nil)
|
releases, _, err := gh.Repositories.ListReleases(context.TODO(), "ansible-semaphore", "semaphore", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user