diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index 2a5b327ad..a17dc363b 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -22,6 +22,7 @@ jobs: version: latest args: release env: + APP_ENV: production GH_OAUTH_CLIENT_ID: 178c6fc778ccc68e1d6a GH_OAUTH_CLIENT_SECRET: ${{secrets.OAUTH_CLIENT_SECRET}} GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/update/checkForUpdate.go b/update/checkForUpdate.go index 807c43d56..ce2af8423 100644 --- a/update/checkForUpdate.go +++ b/update/checkForUpdate.go @@ -20,13 +20,22 @@ type releaseInfo struct { } func CheckForUpdate(handleUpdate chan func()) { + // Only check for updates in production + if os.Getenv("APP_ENV") != "production" { + handleUpdate <- nil + return + } + + // Ignore if this stdout is not a tty if !terminal.IsTerminal(int(os.Stdout.Fd())) { handleUpdate <- nil + return } latestRelease, err := getLatestRelease() if err != nil { handleUpdate <- nil + return } updateAvailable := latestRelease.Version != command.Version