diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index c0ba718e..f6b3638a 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -22,10 +22,10 @@ jobs: cache: 'false' - name: golangci-lint - uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5 # v3.4.0 + uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 with: only-new-issues: true - version: v1.52 + version: v1.54.2 args: --timeout=900s gomodtidy: diff --git a/cmd/artifact/info/info.go b/cmd/artifact/info/info.go index f1bf2a62..45b78097 100644 --- a/cmd/artifact/info/info.go +++ b/cmd/artifact/info/info.go @@ -16,6 +16,7 @@ package info import ( "context" + "errors" "fmt" "strings" @@ -90,14 +91,22 @@ func (o *artifactInfoOptions) RunArtifactInfo(ctx context.Context, args []string } tags, err := repo.Tags(ctx) - if err != nil { - o.Printer.Warning.Printfln("cannot retrieve tags from %q, %v", ref, err) + if err != nil && !errors.Is(err, context.Canceled) { + o.Printer.Warning.Printfln("cannot retrieve tags from t %q, %v", ref, err) continue + } else if errors.Is(err, context.Canceled) { + // When the context is canceled we exit, since we receive a termination signal. + return err } joinedTags := strings.Join(tags, ", ") data = append(data, []string{ref, joinedTags}) } - return o.Printer.PrintTable(output.ArtifactInfo, data) + // Print the table header + data only if there is data. + if len(data) > 0 { + return o.Printer.PrintTable(output.ArtifactInfo, data) + } + + return nil }