Skip to content

Commit f76921b

Browse files
authored
Merge pull request #1686 from getsops/dependabot/go_modules/go-380d3566d7
build(deps): Bump the go group across 1 directory with 18 updates
2 parents 92651ed + 0406503 commit f76921b

File tree

5 files changed

+222
-138
lines changed

5 files changed

+222
-138
lines changed

.github/utils/patch-go.mod.py

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
"""
2+
Patch go.mod so that the lines 'go xxx' to 'toolchain xxx' are as in git's
3+
HEAD.
4+
5+
This is necessary since newer 'go mod tidy' versions tend to modify these
6+
lines. Since we check in CI that 'go mod tidy' does not change go.mod, this
7+
causes CI to fail.
8+
"""
9+
10+
import subprocess
11+
12+
13+
def split_go_mod(contents: str) -> tuple[list[str], list[str], list[str]]:
14+
"""
15+
Given the contents of go.mod, splits it into three lists of lines
16+
(with endings):
17+
1. The lines before 'go';
18+
2. The lines starting with 'go' and ending with 'toolchain';
19+
3. The lines after 'toolchain'.
20+
"""
21+
parts: tuple[list[str], list[str], list[str]] = ([], [], [])
22+
index = 0
23+
for line in contents.splitlines(keepends=True):
24+
next_index = index
25+
if line.startswith('go '):
26+
index = next_index = 1
27+
if line.startswith('toolchain '):
28+
next_index = 2
29+
parts[index].append(line)
30+
index = next_index
31+
return parts
32+
33+
34+
def get_file_contents_from_git_revision(filename: str, revision: str) -> str:
35+
"""
36+
Get the file contents of ``filename`` from Git revision ``revision``.
37+
"""
38+
p = subprocess.run(
39+
['git', 'show', f'{revision}:{filename}'],
40+
stdout=subprocess.PIPE,
41+
check=True,
42+
encoding='utf-8',
43+
)
44+
return p.stdout
45+
46+
47+
def read_file(filename: str) -> str:
48+
"""
49+
Read the file's contents.
50+
"""
51+
with open(filename, 'r', encoding='utf-8') as f:
52+
return f.read()
53+
54+
55+
def write_file(filename: str, contents: str) -> None:
56+
"""
57+
Write the file's contents.
58+
"""
59+
with open(filename, 'w', encoding='utf-8') as f:
60+
f.write(contents)
61+
62+
63+
def main():
64+
"""
65+
Patches go.mod.
66+
"""
67+
filename = 'go.mod'
68+
_, go_versions, __ = split_go_mod(
69+
get_file_contents_from_git_revision(filename, 'HEAD')
70+
)
71+
head, _, tail = split_go_mod(read_file(filename))
72+
lines = head + go_versions + tail
73+
write_file(filename, ''.join(lines))
74+
75+
76+
if __name__ == '__main__':
77+
main()

.github/workflows/cli.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
- name: Vendor Go Modules
4848
run: make vendor
4949

50+
- name: Restore go/toolchain lines of go.mod
51+
run: python3 .github/utils/patch-go.mod.py
52+
5053
- name: Ensure clean working tree
5154
run: git diff --exit-code
5255

.github/workflows/codeql.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ jobs:
4545
# target, which includes a lot more than just the Go files we want to
4646
# scan.
4747
- name: Build
48-
run: make install
48+
run: |
49+
make vendor
50+
make install
4951
5052
- name: Perform CodeQL Analysis
5153
uses: github/codeql-action/analyze@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5

go.mod

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
module github.com/getsops/sops/v3
22

33
go 1.22
4-
5-
toolchain go1.22.5
4+
toolchain go1.22.9
65

76
require (
87
cloud.google.com/go/kms v1.20.1
9-
cloud.google.com/go/storage v1.45.0
8+
cloud.google.com/go/storage v1.47.0
109
filippo.io/age v1.2.0
1110
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0
1211
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0
13-
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.2.0
14-
github.com/ProtonMail/go-crypto v1.1.0-beta.0-proton
15-
github.com/aws/aws-sdk-go-v2 v1.32.2
16-
github.com/aws/aws-sdk-go-v2/config v1.28.0
17-
github.com/aws/aws-sdk-go-v2/credentials v1.17.41
18-
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.34
19-
github.com/aws/aws-sdk-go-v2/service/kms v1.37.2
20-
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.1
21-
github.com/aws/aws-sdk-go-v2/service/sts v1.32.2
12+
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.3.0
13+
github.com/ProtonMail/go-crypto v1.1.2
14+
github.com/aws/aws-sdk-go-v2 v1.32.5
15+
github.com/aws/aws-sdk-go-v2/config v1.28.5
16+
github.com/aws/aws-sdk-go-v2/credentials v1.17.46
17+
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.40
18+
github.com/aws/aws-sdk-go-v2/service/kms v1.37.6
19+
github.com/aws/aws-sdk-go-v2/service/s3 v1.68.0
20+
github.com/aws/aws-sdk-go-v2/service/sts v1.33.1
2221
github.com/blang/semver v3.5.1+incompatible
2322
github.com/fatih/color v1.18.0
2423
github.com/getsops/gopgagent v0.0.0-20240527072608-0c14999532fe
@@ -34,51 +33,51 @@ require (
3433
github.com/ory/dockertest/v3 v3.11.0
3534
github.com/pkg/errors v0.9.1
3635
github.com/sirupsen/logrus v1.9.3
37-
github.com/stretchr/testify v1.9.0
36+
github.com/stretchr/testify v1.10.0
3837
github.com/urfave/cli v1.22.16
39-
golang.org/x/net v0.30.0
40-
golang.org/x/sys v0.26.0
41-
golang.org/x/term v0.25.0
42-
google.golang.org/api v0.203.0
43-
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53
44-
google.golang.org/grpc v1.67.1
45-
google.golang.org/protobuf v1.35.1
38+
golang.org/x/net v0.31.0
39+
golang.org/x/sys v0.27.0
40+
golang.org/x/term v0.26.0
41+
google.golang.org/api v0.209.0
42+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241113202542-65e8d215514f
43+
google.golang.org/grpc v1.68.0
44+
google.golang.org/protobuf v1.35.2
4645
gopkg.in/ini.v1 v1.67.0
4746
gopkg.in/yaml.v3 v3.0.1
4847
)
4948

5049
require (
5150
cel.dev/expr v0.16.1 // indirect
5251
cloud.google.com/go v0.116.0 // indirect
53-
cloud.google.com/go/auth v0.9.9 // indirect
54-
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
52+
cloud.google.com/go/auth v0.10.2 // indirect
53+
cloud.google.com/go/auth/oauth2adapt v0.2.5 // indirect
5554
cloud.google.com/go/compute/metadata v0.5.2 // indirect
56-
cloud.google.com/go/iam v1.2.1 // indirect
57-
cloud.google.com/go/longrunning v0.6.1 // indirect
58-
cloud.google.com/go/monitoring v1.21.1 // indirect
55+
cloud.google.com/go/iam v1.2.2 // indirect
56+
cloud.google.com/go/longrunning v0.6.2 // indirect
57+
cloud.google.com/go/monitoring v1.21.2 // indirect
5958
dario.cat/mergo v1.0.1 // indirect
6059
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
6160
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.0 // indirect
6261
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
63-
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
62+
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.1 // indirect
6463
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.24.1 // indirect
6564
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.1 // indirect
6665
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.48.1 // indirect
6766
github.com/Microsoft/go-winio v0.6.2 // indirect
6867
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
69-
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect
70-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.17 // indirect
71-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.21 // indirect
72-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.21 // indirect
68+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.7 // indirect
69+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.20 // indirect
70+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 // indirect
71+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 // indirect
7372
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
74-
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.21 // indirect
75-
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
76-
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.2 // indirect
77-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.2 // indirect
78-
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.2 // indirect
79-
github.com/aws/aws-sdk-go-v2/service/sso v1.24.2 // indirect
80-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.2 // indirect
81-
github.com/aws/smithy-go v1.22.0 // indirect
73+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.24 // indirect
74+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.1 // indirect
75+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.5 // indirect
76+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.5 // indirect
77+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.5 // indirect
78+
github.com/aws/aws-sdk-go-v2/service/sso v1.24.6 // indirect
79+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.5 // indirect
80+
github.com/aws/smithy-go v1.22.1 // indirect
8281
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
8382
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
8483
github.com/cespare/xxhash/v2 v2.3.0 // indirect
@@ -104,7 +103,7 @@ require (
104103
github.com/google/s2a-go v0.1.8 // indirect
105104
github.com/google/uuid v1.6.0 // indirect
106105
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
107-
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
106+
github.com/googleapis/gax-go/v2 v2.14.0 // indirect
108107
github.com/hashicorp/errwrap v1.1.0 // indirect
109108
github.com/hashicorp/go-multierror v1.1.1 // indirect
110109
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
@@ -139,13 +138,13 @@ require (
139138
go.opentelemetry.io/otel/sdk v1.29.0 // indirect
140139
go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect
141140
go.opentelemetry.io/otel/trace v1.30.0 // indirect
142-
golang.org/x/crypto v0.28.0 // indirect
143-
golang.org/x/oauth2 v0.23.0 // indirect
144-
golang.org/x/sync v0.8.0 // indirect
145-
golang.org/x/text v0.19.0 // indirect
146-
golang.org/x/time v0.7.0 // indirect
147-
google.golang.org/genproto v0.0.0-20241015192408-796eee8c2d53 // indirect
148-
google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect
141+
golang.org/x/crypto v0.29.0 // indirect
142+
golang.org/x/oauth2 v0.24.0 // indirect
143+
golang.org/x/sync v0.9.0 // indirect
144+
golang.org/x/text v0.20.0 // indirect
145+
golang.org/x/time v0.8.0 // indirect
146+
google.golang.org/genproto v0.0.0-20241113202542-65e8d215514f // indirect
147+
google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect
149148
google.golang.org/grpc/stats/opentelemetry v0.0.0-20240907200651-3ffb98b2c93a // indirect
150149
gopkg.in/yaml.v2 v2.4.0 // indirect
151150
)

0 commit comments

Comments
 (0)