Skip to content

Commit 0582aeb

Browse files
cluster-stack-bot[bot]jschoonegarloff
authored
🌱 Update github-actions group (#171)
* 🌱 Update github-actions group | datasource | package | from | to | | ----------- | ------------------------- | ------ | ------ | | github-tags | actions/setup-go | v5.1.0 | v5.3.0 | | github-tags | lycheeverse/lychee-action | v2.1.0 | v2.3.0 | * 🌱 Renovate GitHub actions: go122 fixes (#201) * Use errors.New instead of fmt.Errorf for plain strings. This is what go-1.22 enforces * Also need to import "errors" to use it. * exportloopreg linter has been replaced by copyloopvar. Signed-off-by: Kurt Garloff <[email protected]> --------- Signed-off-by: Kurt Garloff <[email protected]> Co-authored-by: cluster-stack-bot[bot] <143188378+cluster-stack-bot[bot]@users.noreply.github.com> Co-authored-by: Jan Schoone <[email protected]> Co-authored-by: Kurt Garloff <[email protected]>
1 parent cdbcc97 commit 0582aeb

File tree

10 files changed

+26
-22
lines changed

10 files changed

+26
-22
lines changed

.github/actions/setup-go/action.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ runs:
44
using: "composite"
55
steps:
66
- name: Install go
7-
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
7+
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
88
with:
99
go-version-file: "go.mod"
1010
cache: true
@@ -15,14 +15,14 @@ runs:
1515
echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT
1616
echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT
1717
- name: Go Mod Cache
18-
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
18+
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4
1919
with:
2020
path: ${{ steps.go-cache-paths.outputs.go-mod }}
2121
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
2222
restore-keys: |
2323
${{ runner.os }}-go-mod-
2424
- name: Go Build Cache
25-
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4
25+
uses: actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4
2626
with:
2727
path: ${{ steps.go-cache-paths.outputs.go-build }}
2828
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}

.github/workflows/builder-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
1818

1919
- name: Set up Docker Buildx
20-
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
20+
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3
2121

2222
- name: Login to Docker Hub
2323
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
@@ -27,7 +27,7 @@ jobs:
2727
password: ${{ secrets.GITHUB_TOKEN }}
2828

2929
- name: Build and push
30-
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
30+
uses: docker/build-push-action@0adf9959216b96bec444f325f1e493d4aa344497 # v6
3131
with:
3232
file: ./images/builder/Dockerfile
3333
context: ./images/builder

.github/workflows/pr-verify.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Verify Shellcheck
2727
run: make verify-shellcheck
2828

29-
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
29+
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
3030
with:
3131
node-version: "18"
3232
- name: Install renovate

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
with:
1818
fetch-depth: 0
1919
- run: git fetch --force --tags
20-
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5
20+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5
2121
with:
2222
go-version: stable
2323

24-
- uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6
24+
- uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6
2525
with:
2626
distribution: goreleaser
2727
version: latest

.github/workflows/schedule-link-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
private_key: ${{ secrets.SCS_APP_PRIVATE_KEY }}
2222

2323
- name: Link Checker
24-
uses: lycheeverse/lychee-action@f81112d0d2814ded911bd23e3beaa9dda9093915 # v2.1.0
24+
uses: lycheeverse/lychee-action@f613c4a64e50d792e0b31ec34bbcbba12263c6a6 # v2.3.0
2525
id: lychee
2626
env:
2727
GITHUB_TOKEN: "${{ steps.generate-token.outputs.token }}"

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ linters:
77
- bodyclose
88
- containedctx
99
- contextcheck
10+
- copyloopvar
1011
- durationcheck
1112
- errchkjson
1213
- errname
1314
- errorlint
1415
- exhaustive
15-
- exportloopref
1616
- forcetypeassert
1717
- gci
1818
- gocritic

pkg/clusterstack/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ limitations under the License.
1818
package clusterstack
1919

2020
import (
21+
"errors"
2122
"fmt"
2223
"os"
2324
"path/filepath"
@@ -58,11 +59,11 @@ func GetCsctlConfig(path string) (*CsctlConfig, error) {
5859
}
5960

6061
if cs.Config.Provider.Type == "" {
61-
return nil, fmt.Errorf("provider type must not be empty")
62+
return nil, errors.New("provider type must not be empty")
6263
}
6364

6465
if len(cs.Config.Provider.Type) > 253 {
65-
return nil, fmt.Errorf("provider name must not be greater than 253")
66+
return nil, errors.New("provider name must not be greater than 253")
6667
}
6768

6869
match, err := regexp.MatchString(`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`, cs.Config.Provider.Type)
@@ -74,7 +75,7 @@ func GetCsctlConfig(path string) (*CsctlConfig, error) {
7475
}
7576

7677
if cs.Config.ClusterStackName == "" {
77-
return nil, fmt.Errorf("cluster stack name must not be empty")
78+
return nil, errors.New("cluster stack name must not be empty")
7879
}
7980

8081
// Validate kubernetes version

pkg/clusterstack/version.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package clusterstack
1818

1919
import (
20+
"errors"
2021
"fmt"
2122
"regexp"
2223
"strconv"
@@ -30,7 +31,7 @@ func BumpVersion(version string) (string, error) {
3031

3132
// Check if a numeric part was found
3233
if len(matches) < 2 {
33-
return "", fmt.Errorf("invalid version format")
34+
return "", errors.New("invalid version format")
3435
}
3536

3637
// Extract and convert the numeric part to an integer

pkg/cmd/create.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package cmd
1919
import (
2020
"context"
2121
"encoding/json"
22+
"errors"
2223
"fmt"
2324
"os"
2425
"path/filepath"
@@ -185,13 +186,13 @@ func GetCreateOptions(ctx context.Context, clusterStackPath string) (*CreateOpti
185186
}
186187
case customMode:
187188
if clusterStackVersion == "" {
188-
return nil, fmt.Errorf("please specify a semver for custom version with --cluster-stack-version flag")
189+
return nil, errors.New("please specify a semver for custom version with --cluster-stack-version flag")
189190
}
190191
if clusterAddonVersion == "" {
191-
return nil, fmt.Errorf("please specify a semver for custom version with --cluster-addon-version flag")
192+
return nil, errors.New("please specify a semver for custom version with --cluster-addon-version flag")
192193
}
193194
if nodeImageVersion == "" {
194-
return nil, fmt.Errorf("please specify a semver for custom version with --node-image-version flag")
195+
return nil, errors.New("please specify a semver for custom version with --node-image-version flag")
195196
}
196197

197198
createOption.Metadata, err = clusterstack.HandleCustomMode(createOption.Config.Config.KubernetesVersion, clusterStackVersion, clusterAddonVersion, nodeImageVersion)
@@ -222,7 +223,7 @@ func createAction(cmd *cobra.Command, args []string) error {
222223
defer cleanTmpDirectory()
223224

224225
if len(args) != 1 {
225-
return fmt.Errorf("please provide a valid command, create only accept one argument to path to the cluster stacks")
226+
return errors.New("please provide a valid command, create only accept one argument to path to the cluster stacks")
226227
}
227228
clusterStackPath := args[0]
228229

@@ -253,7 +254,7 @@ func (c *CreateOptions) validateHash() error {
253254
if c.CurrentReleaseHash.ClusterAddonDir == c.LatestReleaseHash.ClusterAddonDir &&
254255
c.CurrentReleaseHash.ClusterAddonValues == c.LatestReleaseHash.ClusterAddonValues &&
255256
c.CurrentReleaseHash.NodeImageDir == c.LatestReleaseHash.NodeImageDir {
256-
return fmt.Errorf("no change in the cluster stack")
257+
return errors.New("no change in the cluster stack")
257258
}
258259

259260
return nil
@@ -351,7 +352,7 @@ func (c *CreateOptions) generateRelease(ctx context.Context) error {
351352

352353
if publish {
353354
if remote != "oci" {
354-
return fmt.Errorf("not pushing assets. --publish is only implemented for remote OCI")
355+
return errors.New("not pushing assets. --publish is only implemented for remote OCI")
355356
}
356357

357358
ociClient, err := oci.NewClient()
@@ -410,7 +411,7 @@ func overwriteVersionInFile(chartYaml, newVersion string) error {
410411
v := m["version"]
411412
oldVersion, ok := v.(string)
412413
if !ok {
413-
return fmt.Errorf("failed to read version in yaml")
414+
return errors.New("failed to read version in yaml")
414415
}
415416

416417
m["version"] = newVersion

pkg/hash/hash.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"crypto/sha256"
2222
"encoding/base64"
2323
"encoding/json"
24+
"errors"
2425
"fmt"
2526
"io"
2627
"os"
@@ -111,7 +112,7 @@ func (r ReleaseHash) ValidateWithLatestReleaseHash(latestReleaseHash ReleaseHash
111112
if r.ClusterAddonDir == latestReleaseHash.ClusterAddonDir &&
112113
r.ClusterAddonValues == latestReleaseHash.ClusterAddonValues &&
113114
r.NodeImageDir == latestReleaseHash.NodeImageDir {
114-
return fmt.Errorf("no change in the cluster stack")
115+
return errors.New("no change in the cluster stack")
115116
}
116117

117118
return nil

0 commit comments

Comments
 (0)