Skip to content

Commit d7e6786

Browse files
Bump the github-actions group with 3 updates (#350)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: David Collom <[email protected]>
1 parent d08cbda commit d7e6786

File tree

15 files changed

+38
-38
lines changed

15 files changed

+38
-38
lines changed

.github/workflows/build-test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
with:
2525
go-version-file: go.mod
2626
- name: Run golangci-lint
27-
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
27+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
2828
with:
29-
version: v1.54
30-
args: --timeout 10m --exclude SA5011 --verbose --issues-exit-code=0
29+
version: v2.0.2
30+
args: --timeout 10m --verbose --issues-exit-code=0
3131
only-new-issues: true
3232

3333
govulncheck:
@@ -108,7 +108,7 @@ jobs:
108108
cache-to: type=gha,mode=max
109109

110110
- name: Run Trivy vulnerability scanner
111-
uses: aquasecurity/trivy-action@0.29.0
111+
uses: aquasecurity/trivy-action@0.30.0
112112
with:
113113
image-ref: "quay.io/jetstack/version-checker:${{github.sha}}"
114114
format: "table"

.github/workflows/coverage-badge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
go tool cover -func=coverage.out -o=coverage.out
3030
3131
- name: Go Coverage Badge # Pass the `coverage.out` output to this action
32-
uses: tj-actions/coverage-badge-go@v2
32+
uses: tj-actions/coverage-badge-go@v3
3333
with:
3434
filename: coverage.out
3535

cmd/app/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ func (o *Options) addFlags(cmd *cobra.Command) {
8888

8989
usageFmt := "Usage:\n %s\n"
9090
cmd.SetUsageFunc(func(cmd *cobra.Command) error {
91-
fmt.Fprintf(cmd.OutOrStderr(), usageFmt, cmd.UseLine())
91+
_, _ = fmt.Fprintf(cmd.OutOrStderr(), usageFmt, cmd.UseLine())
9292
cliflag.PrintSections(cmd.OutOrStderr(), nfs, 0)
9393
return nil
9494
})
9595

9696
cmd.SetHelpFunc(func(cmd *cobra.Command, _ []string) {
97-
fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n"+usageFmt, cmd.Long, cmd.UseLine())
97+
_, _ = fmt.Fprintf(cmd.OutOrStdout(), "%s\n\n"+usageFmt, cmd.Long, cmd.UseLine())
9898
cliflag.PrintSections(cmd.OutOrStdout(), nfs, 0)
9999
})
100100

cmd/app/options_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,6 @@ func TestComplete(t *testing.T) {
181181
t.Errorf("unexpected client options, exp=%#+v got=%#+v",
182182
test.expOptions, o.Client)
183183
}
184-
185-
for _, env := range test.envs {
186-
os.Unsetenv(env[0])
187-
}
188184
})
189185
}
190186
}

pkg/client/acr/acr.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (c *Client) Tags(ctx context.Context, host, repo, image string) ([]api.Imag
7878
if err != nil {
7979
return nil, err
8080
}
81-
defer resp.Body.Close()
81+
defer func() { _ = resp.Body.Close() }()
8282

8383
var manifestResp ManifestResponse
8484
if err := json.NewDecoder(resp.Body).Decode(&manifestResp); err != nil {
@@ -212,7 +212,7 @@ func (c *Client) getAccessTokenClient(ctx context.Context, host string) (*acrCli
212212
return nil, fmt.Errorf("%s: failed to request access token: %s",
213213
host, err)
214214
}
215-
defer resp.Body.Close()
215+
defer func() { _ = resp.Body.Close() }()
216216

217217
var respToken AccessTokenResponse
218218
if err := json.NewDecoder(resp.Body).Decode(&respToken); err != nil {

pkg/client/acr/path_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package acr
22

3-
import "testing"
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/assert"
7+
)
48

59
func TestIsHost(t *testing.T) {
610
tests := map[string]struct {
@@ -85,11 +89,9 @@ func TestRepoImage(t *testing.T) {
8589
handler := new(Client)
8690
for name, test := range tests {
8791
t.Run(name, func(t *testing.T) {
88-
if repo, image := handler.RepoImageFromPath(test.path); !(repo == test.expRepo &&
89-
image == test.expImage) {
90-
t.Errorf("%s: unexpected repo/image, exp=%s,%s got=%s,%s",
91-
test.path, test.expRepo, test.expImage, repo, image)
92-
}
92+
repo, image := handler.RepoImageFromPath(test.path)
93+
assert.Equal(t, repo, test.expRepo)
94+
assert.Equal(t, image, test.expImage)
9395
})
9496
}
9597
}

pkg/client/docker/docker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func (c *Client) doRequest(ctx context.Context, url string) (*TagResponse, error
131131
if err != nil {
132132
return nil, fmt.Errorf("failed to get %q image: %s", c.Name(), err)
133133
}
134-
defer resp.Body.Close()
134+
defer func() { _ = resp.Body.Close() }()
135135

136136
body, err := io.ReadAll(resp.Body)
137137
if err != nil {
@@ -165,7 +165,7 @@ func basicAuthSetup(ctx context.Context, client *http.Client, opts Options) (str
165165
if err != nil {
166166
return "", err
167167
}
168-
defer resp.Body.Close()
168+
defer func() { _ = resp.Body.Close() }()
169169

170170
body, err := io.ReadAll(resp.Body)
171171
if err != nil {

pkg/client/ecr/ecr.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ func (c *Client) createClient(ctx context.Context, region string) (*ecr.Client,
9595
if c.IamRoleArn != "" {
9696
cfg, err = config.LoadDefaultConfig(ctx,
9797
config.WithRegion(region),
98-
config.WithHTTPClient(&http.Client{Transport: c.Options.Transporter}),
98+
config.WithHTTPClient(&http.Client{Transport: c.Transporter}),
9999
)
100100
} else {
101101
cfg, err = config.LoadDefaultConfig(ctx,
102102
config.WithCredentialsProvider(
103103
credentials.NewStaticCredentialsProvider(c.AccessKeyID, c.SecretAccessKey, c.SessionToken),
104104
),
105105
config.WithRegion(region),
106-
config.WithHTTPClient(&http.Client{Transport: c.Options.Transporter}),
106+
config.WithHTTPClient(&http.Client{Transport: c.Transporter}),
107107
)
108108
}
109109
if err != nil {

pkg/client/ecr/path_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
package ecr
22

3-
import "testing"
3+
import (
4+
"testing"
5+
6+
"github.com/stretchr/testify/assert"
7+
)
48

59
func TestIsHost(t *testing.T) {
610
tests := map[string]struct {
@@ -98,11 +102,9 @@ func TestRepoImage(t *testing.T) {
98102
handler := new(Client)
99103
for name, test := range tests {
100104
t.Run(name, func(t *testing.T) {
101-
if repo, image := handler.RepoImageFromPath(test.path); !(repo == test.expRepo &&
102-
image == test.expImage) {
103-
t.Errorf("%s: unexpected repo/image, exp=%s,%s got=%s,%s",
104-
test.path, test.expRepo, test.expImage, repo, image)
105-
}
105+
repo, image := handler.RepoImageFromPath(test.path)
106+
assert.Equal(t, repo, test.expRepo)
107+
assert.Equal(t, image, test.expImage)
106108
})
107109
}
108110
}

pkg/client/gcr/gcr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (c *Client) Tags(ctx context.Context, host, repo, image string) ([]api.Imag
6262
if err != nil {
6363
return nil, fmt.Errorf("failed to get %q image: %w", c.Name(), err)
6464
}
65-
defer resp.Body.Close()
65+
defer func() { _ = resp.Body.Close() }()
6666

6767
body, err := io.ReadAll(resp.Body)
6868
if err != nil {

0 commit comments

Comments
 (0)