Skip to content

Commit

Permalink
chore: update dependencies (#652)
Browse files Browse the repository at this point in the history
* chore: update dependencies

* fix: fix lint errors

* ci(ghalint): fix lint errors

* ci: fix a permission
  • Loading branch information
suzuki-shunsuke authored Mar 23, 2024
1 parent 3d2a6d7 commit c44ca20
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 77 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ on:
permissions: {}
jobs:
actionlint:
uses: suzuki-shunsuke/actionlint-workflow/.github/workflows/actionlint.yaml@b6a5f966d4504893b2aeb60cf2b0de8946e48504 # v0.5.0
uses: suzuki-shunsuke/actionlint-workflow/.github/workflows/actionlint.yaml@8d67cddd56ea4b045e858700595d49b2fe09de61 # v1.0.0
if: |
! github.event.pull_request.head.repo.fork
with:
aqua_version: v2.21.0
aqua_version: v2.25.1
permissions:
pull-requests: write
contents: read
Expand All @@ -26,9 +26,9 @@ jobs:
permissions: {}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: aquaproj/aqua-installer@928a2ee4243a9ee8312d80dc8cbaca88fb602a91 # v2.2.0
- uses: aquaproj/aqua-installer@4551ec64e21bf0f557c2525135ff0bd2cba40ec7 # v3.0.0
with:
aqua_version: v2.21.0
aqua_version: v2.25.1
- run: actionlint
env:
GITHUB_TOKEN: ${{github.token}}
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on:
tags: [v*]
jobs:
release:
uses: suzuki-shunsuke/go-release-workflow/.github/workflows/release.yaml@dc7096a64b1f1f8426fe836000f291e8b37dae3a # v0.5.0
uses: suzuki-shunsuke/go-release-workflow/.github/workflows/release.yaml@df72518e53868ca4996ae8d026c952309bbee13c # v1.0.0
with:
go-version: 1.21.4
aqua_version: v2.21.0
go-version: 1.22.1
aqua_version: v2.25.1
secrets:
gh_app_id: ${{secrets.APP_ID}}
gh_app_private_key: ${{secrets.APP_PRIVATE_KEY}}
Expand Down
61 changes: 19 additions & 42 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
permissions: {}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: aquaproj/aqua-installer@928a2ee4243a9ee8312d80dc8cbaca88fb602a91 # v2.2.0
- uses: aquaproj/aqua-installer@4551ec64e21bf0f557c2525135ff0bd2cba40ec7 # v3.0.0
with:
aqua_version: v2.21.0
aqua_version: v2.25.1
env:
AQUA_GITHUB_TOKEN: ${{github.token}}
- run: ghalint run
Expand All @@ -47,37 +47,18 @@ jobs:

update-aqua-checksums:
# Update aqua-checksums.json and push a commit
runs-on: ubuntu-latest
needs: path-filter
permissions: {}
permissions:
contents: read # The reusable workflow requires contents:read
if: |
needs.path-filter.outputs.update-aqua-checksums == 'true'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Generate token
id: generate_token
if: "! github.event.pull_request.head.repo.fork"
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
with:
app_id: ${{secrets.APP_ID}}
private_key: ${{secrets.APP_PRIVATE_KEY}}
- uses: aquaproj/aqua-installer@928a2ee4243a9ee8312d80dc8cbaca88fb602a91 # v2.2.0
# Install ghcp
with:
aqua_version: v2.21.0
env:
AQUA_GITHUB_TOKEN: ${{github.token}}
- uses: aquaproj/update-checksum-action@0fef5fa12e81e046bb29078f76b99bb29fa4e696 # v0.2.3
with:
prune: true
skip_push: ${{github.event.pull_request.head.repo.fork}}
env:
# To trigger GitHub Actions Workflow by pushing a commit, GitHub App token is required.
# github.token doesn't trigger GitHub Actions Workflow.
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
# > When you use the repository's GITHUB_TOKEN to perform tasks, events triggered by the GITHUB_TOKEN, with the exception of workflow_dispatch and repository_dispatch, will not create a new workflow run.
GITHUB_TOKEN: ${{steps.generate_token.outputs.token}}
uses: aquaproj/update-checksum-workflow/.github/workflows/update-checksum.yaml@f367004e7f17e99d30297cd9e89afad30ee1f251 # v1.0.0
with:
aqua_version: v2.25.1
prune: true
secrets:
gh_app_id: ${{secrets.APP_ID}}
gh_app_private_key: ${{secrets.APP_PRIVATE_KEY}}

renovate-config-validator:
# Validate Renovate Configuration by renovate-config-validator.
Expand All @@ -100,16 +81,12 @@ jobs:
if: |
! failure() && ! cancelled() && github.event.pull_request.user.login == 'renovate[bot]' && contains(github.event.pull_request.body, ' **Automerge**: Enabled.')
steps:
- name: Generate token
id: generate_token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
- uses: suzuki-shunsuke/enable-auto-merge-action@ec074392e76cd1062925255cd82a86ea1c44b6fd # v0.1.0
with:
app_id: ${{secrets.APP_ID}}
private_key: ${{secrets.APP_PRIVATE_KEY}}
- run: gh -R "$GITHUB_REPOSITORY" pr merge --squash --auto --delete-branch "$PR_NUMBER"
env:
GITHUB_TOKEN: ${{steps.generate_token.outputs.token}} # Use GitHub App to trigger GitHub Actions Workflow by merge commit.
PR_NUMBER: ${{github.event.pull_request.number}}
pr_number: ${{github.event.pull_request.number}}
merge_method: squash
github_app_id: ${{secrets.APP_ID}}
github_app_private_key: ${{secrets.APP_PRIVATE_KEY}}

status-check:
# This job is used for main branch's branch protection rule's status check.
Expand All @@ -126,10 +103,10 @@ jobs:
- run: exit 1

test:
uses: suzuki-shunsuke/go-test-workflow/.github/workflows/test.yaml@66610a63dfe5160d97e1b68bc53949ceed18e0db # v0.5.0
uses: suzuki-shunsuke/go-test-workflow/.github/workflows/test.yaml@fd6e66427230606a7d71e686d01e3eed92ae5012 # v1.0.0
with:
aqua_version: v2.21.0
go-version: 1.21.4
aqua_version: v2.25.1
go-version: 1.22.1
permissions:
pull-requests: write
contents: read
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ linters:
- exhaustruct
- nosnakecase
- musttag
- depguard
28 changes: 14 additions & 14 deletions aqua/aqua-checksums.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"checksums": [
{
"id": "github_release/github.com/golangci/golangci-lint/v1.51.1/golangci-lint-1.51.1-darwin-amd64.tar.gz",
"checksum": "FBA08ACC4027F69F07CEF48FBFF70B8A7ECDFAA1C2ABA9AD3FB31D60D9F5D4BC",
"id": "github_release/github.com/golangci/golangci-lint/v1.57.1/golangci-lint-1.57.1-darwin-amd64.tar.gz",
"checksum": "7B6CE262D6B318822AD6AD866DA31A7E0E8F8042EC2B1A34018488532D9BEB50",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/golangci/golangci-lint/v1.51.1/golangci-lint-1.51.1-darwin-arm64.tar.gz",
"checksum": "75B8F0FF3A4E68147156BE4161A49D4576F1BE37A0B506473F8C482140C1E7F2",
"id": "github_release/github.com/golangci/golangci-lint/v1.57.1/golangci-lint-1.57.1-darwin-arm64.tar.gz",
"checksum": "0099453F7F9EDF7438C848D2F1CEBFE8BD2FE8EF8817BA89C315127CCDDDDEE4",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/golangci/golangci-lint/v1.51.1/golangci-lint-1.51.1-linux-amd64.tar.gz",
"checksum": "17AEB26C76820C22EFA0E1838B0AB93E90CFEDEF43FBFC9A2F33F27EB9E5E070",
"id": "github_release/github.com/golangci/golangci-lint/v1.57.1/golangci-lint-1.57.1-linux-amd64.tar.gz",
"checksum": "7E148DF10DE55DCBDA283B43B9EA1C2F2A38B6E96BA91A71EC02EEFCF336EFBE",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/golangci/golangci-lint/v1.51.1/golangci-lint-1.51.1-linux-arm64.tar.gz",
"checksum": "9744BC34E7B8D82CA788B667BFB7155A39B4BE9AEF43BF9F10318B1372CEA338",
"id": "github_release/github.com/golangci/golangci-lint/v1.57.1/golangci-lint-1.57.1-linux-arm64.tar.gz",
"checksum": "55708F17C659D1B4589FE2B2F6C1D5528F5E3D9376D6E26D4AE266346D035D06",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/golangci/golangci-lint/v1.51.1/golangci-lint-1.51.1-windows-amd64.zip",
"checksum": "722D7B87B9CDDA0A3835D5030B3FC5385C2EBA4C107F63F6391CFB2AC35F051D",
"id": "github_release/github.com/golangci/golangci-lint/v1.57.1/golangci-lint-1.57.1-windows-amd64.zip",
"checksum": "7383A7DC7498AD4D0500FF6E661E50236216089CF68460F665553B9484C41601",
"algorithm": "sha256"
},
{
"id": "github_release/github.com/golangci/golangci-lint/v1.51.1/golangci-lint-1.51.1-windows-arm64.zip",
"checksum": "EB57F9BCB56646F2E3D6CCAF02EC227815FB05077B2E0B1BF9E755805ACDC2B9",
"id": "github_release/github.com/golangci/golangci-lint/v1.57.1/golangci-lint-1.57.1-windows-arm64.zip",
"checksum": "7B2429923A74E9501D3E350E789F5032A36D604C5B1677959B3970DA48858191",
"algorithm": "sha256"
},
{
Expand Down Expand Up @@ -216,8 +216,8 @@
"algorithm": "sha256"
},
{
"id": "registries/github_content/github.com/aquaproj/aqua-registry/v4.154.0/registry.yaml",
"checksum": "5DCD72D7FD7904128496F7AF9D631FEFBDAB0C6B1DF86ED12812AF6B4B1D19C5",
"id": "registries/github_content/github.com/aquaproj/aqua-registry/v4.155.0/registry.yaml",
"checksum": "8D328C01EB7752D6900D21876BC2E73197BE7EA82A6760ED1C8DB369F08149F9",
"algorithm": "sha256"
}
]
Expand Down
2 changes: 1 addition & 1 deletion aqua/aqua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
# https://aquaproj.github.io/
registries:
- type: standard
ref: v4.154.0 # renovate: depName=aquaproj/aqua-registry
ref: v4.155.0 # renovate: depName=aquaproj/aqua-registry
packages:
- import: imports/*.yaml
2 changes: 1 addition & 1 deletion aqua/imports/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
packages:
- name: golangci/golangci-lint@v1.51.1
- name: golangci/golangci-lint@v1.57.1
6 changes: 3 additions & 3 deletions pkg/checkrepo/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ func CheckRedirect(ctx context.Context, afs afero.Fs, httpClient *http.Client, p
}
defer resp.Body.Close()

if resp.StatusCode < 300 { //nolint:gomnd,usestdlibvars
if resp.StatusCode < 300 { //nolint:gomnd
return nil, nil //nolint:nilnil
}
if resp.StatusCode >= 500 { //nolint:gomnd,usestdlibvars
if resp.StatusCode >= 500 { //nolint:gomnd
return nil, logerr.WithFields(errors.New("http status code >= 500"), logrus.Fields{ //nolint:wrapcheck
"http_status_code": resp.StatusCode,
})
}
if resp.StatusCode >= 400 { //nolint:gomnd,usestdlibvars
if resp.StatusCode >= 400 { //nolint:gomnd
return nil, logerr.WithFields(errors.New("http status code >= 400"), logrus.Fields{ //nolint:wrapcheck
"http_status_code": resp.StatusCode,
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/check_repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Azure/aztfexport
func (runner *Runner) checkRepoAction(c *cli.Context) error {
return checkrepo.CheckRepo( //nolint:wrapcheck
c.Context, afero.NewOsFs(), &http.Client{
CheckRedirect: func(req *http.Request, via []*http.Request) error {
CheckRedirect: func(_ *http.Request, _ []*http.Request) error {
return http.ErrUseLastResponse
},
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/cli/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if command -v aqua-registry &> /dev/null; then source <(aqua-registry completion
}
}

func (runner *Runner) bashCompletionAction(c *cli.Context) error {
func (runner *Runner) bashCompletionAction(_ *cli.Context) error {
// https:/urfave/cli/blob/main/autocomplete/bash_autocomplete
// https:/urfave/cli/blob/c3f51bed6fffdf84227c5b59bd3f2e90683314df/autocomplete/bash_autocomplete#L5-L20
fmt.Fprintln(runner.Stdout, `
Expand All @@ -61,7 +61,7 @@ complete -o bashdefault -o default -o nospace -F _cli_bash_autocomplete aqua-reg
return nil
}

func (runner *Runner) zshCompletionAction(c *cli.Context) error {
func (runner *Runner) zshCompletionAction(_ *cli.Context) error {
// https:/urfave/cli/blob/main/autocomplete/zsh_autocomplete
// https:/urfave/cli/blob/947f9894eef4725a1c15ed75459907b52dde7616/autocomplete/zsh_autocomplete
fmt.Fprintln(runner.Stdout, `
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/generate_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ No argument is needed.
}
}

func (runner *Runner) generateRegistryAction(c *cli.Context) error {
func (runner *Runner) generateRegistryAction(_ *cli.Context) error {
return genrg.GenerateRegistry() //nolint:wrapcheck
}
2 changes: 1 addition & 1 deletion pkg/initcmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

const filePermission os.FileMode = 0o644

func Init(ctx context.Context) error {
func Init(_ context.Context) error {
if err := initRegistryYAML(); err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/mv/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const (
filePermission os.FileMode = 0o644
)

func Move(ctx context.Context, afs afero.Fs, oldPackageName, newPackageName string) error {
func Move(_ context.Context, afs afero.Fs, oldPackageName, newPackageName string) error {
// Check if the old package exists
oldPkgPath := filepath.Join("pkgs", filepath.FromSlash(oldPackageName))
newPkgPath := filepath.Join("pkgs", filepath.FromSlash(newPackageName))
Expand Down
3 changes: 1 addition & 2 deletions pkg/mv/registry_ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ func insertAliases(value ast.Node, idx int, oldPackageName string) error {
return errors.New("value must be a mapping node")
}

f, err := parser.ParseBytes([]byte(fmt.Sprintf(`aliases:
- name: %s`, oldPackageName)), parser.ParseComments)
f, err := parser.ParseBytes([]byte("aliases:\n - name: "+oldPackageName), parser.ParseComments)
if err != nil {
return fmt.Errorf("parse text as YAML: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/scaffold/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func aquaGR(ctx context.Context, pkgName, pkgFilePath, rgFilePath string, cmds s
}
defer outFile.Close()
var cmd *exec.Cmd
command := fmt.Sprintf("+ aqua gr --out-testdata %s", pkgFilePath)
command := "+ aqua gr --out-testdata " + pkgFilePath
args := []string{"gr", "-out-testdata", pkgFilePath}
if cmds != "" {
args = append(args, "-cmd", cmds)
Expand Down

0 comments on commit c44ca20

Please sign in to comment.