diff --git a/go.mod b/go.mod index fc8be4ff583..3e9cfe9530a 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,7 @@ module github.com/tektoncd/pipeline go 1.22 +toolchain go1.22.4 require ( github.com/Microsoft/go-winio v0.6.2 // indirect @@ -14,7 +15,7 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/golang-lru v1.0.2 - github.com/jenkins-x/go-scm v1.14.34 + github.com/jenkins-x/go-scm v1.14.37 github.com/mitchellh/go-homedir v1.1.0 github.com/opencontainers/image-spec v1.1.0 github.com/pkg/errors v0.9.1 diff --git a/go.sum b/go.sum index 0f7056c1f16..a844f476762 100644 --- a/go.sum +++ b/go.sum @@ -736,8 +736,8 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jellydator/ttlcache/v3 v3.2.0 h1:6lqVJ8X3ZaUwvzENqPAobDsXNExfUJd61u++uW8a3LE= github.com/jellydator/ttlcache/v3 v3.2.0/go.mod h1:hi7MGFdMAwZna5n2tuvh63DvFLzVKySzCVW6+0gA2n4= -github.com/jenkins-x/go-scm v1.14.34 h1:317hYX1YhuFXm71R5Le6et2MtTxAEjeq6OZcZtyKB58= -github.com/jenkins-x/go-scm v1.14.34/go.mod h1:xY4ZqijM05jodyXQCyhb+AywJBytXjMLVijkpBHk/aQ= +github.com/jenkins-x/go-scm v1.14.37 h1:Tq59JXyg5p4iuvIKf6+EA+Yzgxgpn/yG/yfM1mL8DDg= +github.com/jenkins-x/go-scm v1.14.37/go.mod h1:MRLj/i0mhpMtqwwZV+x78SkEB8mx9rv3ebdRg9WunS8= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= diff --git a/vendor/github.com/jenkins-x/go-scm/scm/client.go b/vendor/github.com/jenkins-x/go-scm/scm/client.go index 500a0835ecb..d6b152a9cd2 100644 --- a/vendor/github.com/jenkins-x/go-scm/scm/client.go +++ b/vendor/github.com/jenkins-x/go-scm/scm/client.go @@ -7,10 +7,8 @@ package scm import ( "context" "errors" - "io" "net/http" - "net/url" "strconv" "strings" @@ -182,6 +180,8 @@ func (c *Client) Do(ctx context.Context, in *Request) (*Response, error) { if client == nil { client = http.DefaultClient } + // The callers of this method should do the closing + //nolint:bodyclose res, err := client.Do(req) if err != nil { return nil, err diff --git a/vendor/github.com/jenkins-x/go-scm/scm/const.go b/vendor/github.com/jenkins-x/go-scm/scm/const.go index 9ac83b17d7f..3f1db75fa62 100644 --- a/vendor/github.com/jenkins-x/go-scm/scm/const.go +++ b/vendor/github.com/jenkins-x/go-scm/scm/const.go @@ -157,7 +157,7 @@ func (a Action) String() (s string) { case ActionCompleted: return "completed" default: - return + return "" } } diff --git a/vendor/github.com/jenkins-x/go-scm/scm/driver/azure/webhook.go b/vendor/github.com/jenkins-x/go-scm/scm/driver/azure/webhook.go index d2e6f0daa89..7eaabe09c74 100644 --- a/vendor/github.com/jenkins-x/go-scm/scm/driver/azure/webhook.go +++ b/vendor/github.com/jenkins-x/go-scm/scm/driver/azure/webhook.go @@ -93,9 +93,8 @@ func getIssueCommentAction(src *issueCommentPullRequestHook) scm.Action { return scm.ActionDelete } else if src.Resource.Comment.PublishedDate.Equal(src.Resource.Comment.LastUpdatedDate) { return scm.ActionCreate - } else { - return scm.ActionEdited } + return scm.ActionEdited } func convertPushHook(src *pushHook) *scm.PushHook { diff --git a/vendor/github.com/jenkins-x/go-scm/scm/driver/fake/repo.go b/vendor/github.com/jenkins-x/go-scm/scm/driver/fake/repo.go index e76357e1c81..c8b688075b8 100644 --- a/vendor/github.com/jenkins-x/go-scm/scm/driver/fake/repo.go +++ b/vendor/github.com/jenkins-x/go-scm/scm/driver/fake/repo.go @@ -179,8 +179,8 @@ func (s *repositoryService) ListHooks(ctx context.Context, fullName string, opts } func (s *repositoryService) CreateHook(ctx context.Context, fullName string, input *scm.HookInput) (*scm.Hook, *scm.Response, error) { - /* #nosec */ hook := &scm.Hook{ + //nolint:gosec ID: fmt.Sprintf("%d", rand.Int()), Name: input.Name, Target: input.Target, diff --git a/vendor/github.com/jenkins-x/go-scm/scm/driver/gitea/webhook.go b/vendor/github.com/jenkins-x/go-scm/scm/driver/gitea/webhook.go index 763c7578b96..f0f20a50cf5 100644 --- a/vendor/github.com/jenkins-x/go-scm/scm/driver/gitea/webhook.go +++ b/vendor/github.com/jenkins-x/go-scm/scm/driver/gitea/webhook.go @@ -424,6 +424,6 @@ func convertAction(src string) (action scm.Action) { case "reviewed": return scm.ActionSubmitted default: - return + return 0 } } diff --git a/vendor/github.com/jenkins-x/go-scm/scm/driver/github/release.go b/vendor/github.com/jenkins-x/go-scm/scm/driver/github/release.go index 82b2e350eb5..b8526aa8a89 100644 --- a/vendor/github.com/jenkins-x/go-scm/scm/driver/github/release.go +++ b/vendor/github.com/jenkins-x/go-scm/scm/driver/github/release.go @@ -32,6 +32,7 @@ type releaseInput struct { Commitish string `json:"target_commitish,omitempty"` Draft bool `json:"draft"` Prerelease bool `json:"prerelease"` + MakeLatest string `json:"make_latest"` } func (s *releaseService) Find(ctx context.Context, repo string, id int) (*scm.Release, *scm.Response, error) { @@ -97,6 +98,9 @@ func (s *releaseService) Update(ctx context.Context, repo string, id int, input } in.Draft = input.Draft in.Prerelease = input.Prerelease + if !(in.Prerelease || in.Draft) { + in.MakeLatest = "true" + } out := new(release) res, err := s.client.do(ctx, "PATCH", path, in, out) return convertRelease(out), res, err diff --git a/vendor/github.com/jenkins-x/go-scm/scm/pr.go b/vendor/github.com/jenkins-x/go-scm/scm/pr.go index 45bed6d85aa..df118450595 100644 --- a/vendor/github.com/jenkins-x/go-scm/scm/pr.go +++ b/vendor/github.com/jenkins-x/go-scm/scm/pr.go @@ -215,7 +215,7 @@ func ToMergeableState(text string) MergeableState { switch strings.ToLower(text) { case "clean", "mergeable", "can_be_merged": return MergeableStateMergeable - case "conflict", "conflicting", "cannot_be_merged": + case "dirty", "conflict", "conflicting", "cannot_be_merged": return MergeableStateConflicting default: return MergeableStateUnknown diff --git a/vendor/modules.txt b/vendor/modules.txt index e7e3f66624c..93e1b2fcbc0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -722,8 +722,8 @@ github.com/jbenet/go-context/io # github.com/jellydator/ttlcache/v3 v3.2.0 ## explicit; go 1.18 github.com/jellydator/ttlcache/v3 -# github.com/jenkins-x/go-scm v1.14.34 -## explicit; go 1.19 +# github.com/jenkins-x/go-scm v1.14.37 +## explicit; go 1.22.3 github.com/jenkins-x/go-scm/pkg/hmac github.com/jenkins-x/go-scm/scm github.com/jenkins-x/go-scm/scm/driver/azure