Skip to content

Commit 49fbb0d

Browse files
authored
Merge pull request #1684 from nicklasfrahm/feature/remote-version
Allow users to disable version check via environment variable
2 parents a89f885 + 0a3d4e3 commit 49fbb0d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cmd/sops/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,8 +1523,9 @@ func main() {
15231523
Usage: "generate a new data encryption key and reencrypt all values with the new key",
15241524
},
15251525
cli.BoolFlag{
1526-
Name: "disable-version-check",
1527-
Usage: "do not check whether the current version is latest during --version",
1526+
Name: "disable-version-check",
1527+
Usage: "do not check whether the current version is latest during --version",
1528+
EnvVar: "SOPS_DISABLE_VERSION_CHECK",
15281529
},
15291530
cli.StringFlag{
15301531
Name: "kms, k",

version/version.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ import (
1515
var Version = "3.9.4"
1616

1717
// PrintVersion prints the current version of sops. If the flag
18-
// `--disable-version-check` is set, the function will not attempt
19-
// to retrieve the latest version from the GitHub API.
18+
// `--disable-version-check` is set or if the environment variable
19+
// SOPS_DISABLE_VERSION_CHECK is set to a value that is considered
20+
// true by https://pkg.go.dev/strconv#ParseBool, the function will
21+
// not attempt to retrieve the latest version from the GitHub API.
2022
//
2123
// If the flag is not set, the function will attempt to retrieve
2224
// the latest version from the GitHub API and compare it to the

0 commit comments

Comments
 (0)