From a6572d2df58f1e526a0e0694c5bfd59b04b93e7e Mon Sep 17 00:00:00 2001 From: Noel Georgi Date: Fri, 1 Mar 2024 11:08:01 +0530 Subject: [PATCH] fix: error in checkoutt diff Fixes an error with checking out repository. Also rekres and bump deps. Signed-off-by: Noel Georgi --- .conform.yaml | 77 +++++++++++--------- Dockerfile | 4 +- Makefile | 8 +- cmd/conform/serve.go | 6 +- go.mod | 2 +- go.sum | 4 +- internal/policy/commit/check_gpg_identity.go | 2 +- internal/reporter/reporter.go | 2 +- 8 files changed, 58 insertions(+), 47 deletions(-) diff --git a/.conform.yaml b/.conform.yaml index 2e270b3b..1307cad4 100644 --- a/.conform.yaml +++ b/.conform.yaml @@ -1,37 +1,48 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2022-09-19T19:55:11Z by kres 255fc05. +# Generated on 2024-03-01T05:36:30Z by kres latest. ---- policies: -- type: commit - spec: - dco: true - gpg: - required: true - identity: - gitHubOrganization: siderolabs - spellcheck: - locale: US - maximumOfOneCommit: true - header: - length: 89 - imperative: true - case: lower - invalidLastCharacters: . - body: - required: true - conventional: - types: ["chore","docs","perf","refactor","style","test","release"] - scopes: [".*"] -- type: license - spec: - skipPaths: - - .git/ - - testdata/ - includeSuffixes: - - .go - excludeSuffixes: - - .pb.go - - .pb.gw.go - header: "// This Source Code Form is subject to the terms of the Mozilla Public\u000A// License, v. 2.0. If a copy of the MPL was not distributed with this\u000A// file, You can obtain one at http://mozilla.org/MPL/2.0/.\u000A" + - type: commit + spec: + dco: true + gpg: + required: true + identity: + gitHubOrganization: siderolabs + spellcheck: + locale: US + maximumOfOneCommit: true + header: + length: 89 + imperative: true + case: lower + invalidLastCharacters: . + body: + required: true + conventional: + types: + - chore + - docs + - perf + - refactor + - style + - test + - release + scopes: + - .* + - type: license + spec: + root: . + skipPaths: + - .git/ + - testdata/ + includeSuffixes: + - .go + excludeSuffixes: + - .pb.go + - .pb.gw.go + header: | + // This Source Code Form is subject to the terms of the Mozilla Public + // License, v. 2.0. If a copy of the MPL was not distributed with this + // file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/Dockerfile b/Dockerfile index 3f817fa7..2b3800f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-02-15T11:12:36Z by kres latest. +# Generated on 2024-03-01T05:36:30Z by kres latest. ARG TOOLCHAIN @@ -11,7 +11,7 @@ FROM ghcr.io/siderolabs/ca-certificates:v1.6.0 AS image-ca-certificates FROM ghcr.io/siderolabs/fhs:v1.6.0 AS image-fhs # runs markdownlint -FROM docker.io/node:21.6.1-alpine3.19 AS lint-markdown +FROM docker.io/node:21.6.2-alpine3.19 AS lint-markdown WORKDIR /src RUN npm i -g markdownlint-cli@0.39.0 RUN npm i sentences-per-line@0.2.1 diff --git a/Makefile b/Makefile index 8d323530..88ff9083 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT. # -# Generated on 2024-02-15T11:12:36Z by kres latest. +# Generated on 2024-03-01T05:36:30Z by kres latest. # common variables @@ -18,11 +18,11 @@ PROTOBUF_GO_VERSION ?= 1.32.0 GRPC_GO_VERSION ?= 1.3.0 GRPC_GATEWAY_VERSION ?= 2.19.1 VTPROTOBUF_VERSION ?= 0.6.0 -DEEPCOPY_VERSION ?= v0.5.5 -GOLANGCILINT_VERSION ?= v1.56.1 +DEEPCOPY_VERSION ?= v0.5.6 +GOLANGCILINT_VERSION ?= v1.56.2 GOFUMPT_VERSION ?= v0.6.0 GO_VERSION ?= 1.22.0 -GOIMPORTS_VERSION ?= v0.17.0 +GOIMPORTS_VERSION ?= v0.18.0 GO_BUILDFLAGS ?= GO_LDFLAGS ?= CGO_ENABLED ?= 0 diff --git a/cmd/conform/serve.go b/cmd/conform/serve.go index 28229281..18d1cecb 100644 --- a/cmd/conform/serve.go +++ b/cmd/conform/serve.go @@ -17,7 +17,7 @@ import ( git "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/config" "github.com/go-git/go-git/v5/plumbing" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "github.com/spf13/cobra" ) @@ -91,7 +91,7 @@ var serveCmd = &cobra.Command{ id := pullRequestEvent.GetPullRequest().GetNumber() - ref := plumbing.ReferenceName(pullRequestEvent.GetPullRequest().GetHead().GetRef()) + ref := pullRequestEvent.GetPullRequest().GetHead().GetRef() refSpec := fmt.Sprintf("refs/pull/%d/head:%s", id, ref) @@ -116,7 +116,7 @@ var serveCmd = &cobra.Command{ } err = worktree.Checkout(&git.CheckoutOptions{ - Branch: ref, + Branch: plumbing.NewBranchReferenceName(ref), }) if err != nil { log.Printf("failed to checkout %q: %v", ref, err) diff --git a/go.mod b/go.mod index e7b57847..c2410136 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/denormal/go-gitignore v0.0.0-20180930084346-ae8ad1d07817 github.com/go-git/go-git/v5 v5.11.0 github.com/golangci/misspell v0.4.1 - github.com/google/go-github/v59 v59.0.0 + github.com/google/go-github/v60 v60.0.0 github.com/jdkato/prose/v3 v3.0.0-20210921205322-a376476c2627 github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4 github.com/mitchellh/mapstructure v1.5.0 diff --git a/go.sum b/go.sum index 61617faf..14bd057f 100644 --- a/go.sum +++ b/go.sum @@ -47,8 +47,8 @@ github.com/golangci/misspell v0.4.1/go.mod h1:9mAN1quEo3DlpbaIKKyEvRxK1pwqR9s/Se github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-github/v59 v59.0.0 h1:7h6bgpF5as0YQLLkEiVqpgtJqjimMYhBkD4jT5aN3VA= -github.com/google/go-github/v59 v59.0.0/go.mod h1:rJU4R0rQHFVFDOkqGWxfLNo6vEk4dv40oDjhV/gH6wM= +github.com/google/go-github/v60 v60.0.0 h1:oLG98PsLauFvvu4D/YPxq374jhSxFYdzQGNCyONLfn8= +github.com/google/go-github/v60 v60.0.0/go.mod h1:ByhX2dP9XT9o/ll2yXAu2VD8l5eNVg8hD4Cr0S/LmQk= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= diff --git a/internal/policy/commit/check_gpg_identity.go b/internal/policy/commit/check_gpg_identity.go index 1ab7e133..efe66911 100644 --- a/internal/policy/commit/check_gpg_identity.go +++ b/internal/policy/commit/check_gpg_identity.go @@ -11,7 +11,7 @@ import ( "net/http" "sync" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" "golang.org/x/sync/errgroup" "github.com/siderolabs/conform/internal/git" diff --git a/internal/reporter/reporter.go b/internal/reporter/reporter.go index 478ebcb7..554f8032 100644 --- a/internal/reporter/reporter.go +++ b/internal/reporter/reporter.go @@ -15,7 +15,7 @@ import ( "path" "strings" - "github.com/google/go-github/v59/github" + "github.com/google/go-github/v60/github" ) // Reporter describes a hook for sending summarized results to a remote API.