diff --git a/.gitignore b/.gitignore index b717f86..ed0f7a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +*.iml .idea dist/ diff --git a/go.mod b/go.mod index 84ed55d..f93f318 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/Staffbase/yamllint-action go 1.15 require ( - github.com/google/go-github/v27 v27.0.6 - github.com/ldez/ghactions v1.0.1 + github.com/google/go-github/v32 v32.1.0 + github.com/ldez/ghactions v1.3.0 ) diff --git a/go.sum b/go.sum index 39b39b1..63d4f1e 100644 --- a/go.sum +++ b/go.sum @@ -1,13 +1,14 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-github/v27 v27.0.4/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0= -github.com/google/go-github/v27 v27.0.6 h1:oiOZuBmGHvrGM1X9uNUAUlLgp5r1UUO/M/KnbHnLRlQ= -github.com/google/go-github/v27 v27.0.6/go.mod h1:/0Gr8pJ55COkmv+S/yPKCczSkUPIM/LnFyubufRNIS0= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-github/v32 v32.0.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI= +github.com/google/go-github/v32 v32.1.0 h1:GWkQOdXqviCPx7Q7Fj+KyPoGm4SwHRh8rheoPhd27II= +github.com/google/go-github/v32 v32.1.0/go.mod h1:rIEpZD9CTDQwDK9GDrtMTycQNA4JU3qBsCizh3q2WCI= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/ldez/ghactions v1.0.1 h1:JsqG7LXRvj0WFmX9mQAIaRqc/OtgaIil25LJTfBlkWw= -github.com/ldez/ghactions v1.0.1/go.mod h1:zYZtWfonB81WLzxbPk/51gVQr1i4K+x57h3C0ZlmfS0= +github.com/ldez/ghactions v1.3.0 h1:+GeP6a1ly8IAzSkC7ENJmoAxaP8E/AWWSCaxvNAgnts= +github.com/ldez/ghactions v1.3.0/go.mod h1:QD/TuOwDQgTajOl/ePSP5md1ml3X/V0Fg1VTh090ivQ= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -15,11 +16,9 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20190212230446-3e8b2be13635 h1:dOJmQysgY8iOBECuNp0vlKHWEtfiTnyjisEizRV3/4o= -golang.org/x/oauth2 v0.0.0-20190212230446-3e8b2be13635/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= diff --git a/yamllint-action.go b/yamllint-action.go index f45e479..be3c753 100644 --- a/yamllint-action.go +++ b/yamllint-action.go @@ -25,7 +25,7 @@ import ( "strconv" "strings" - "github.com/google/go-github/v27/github" + "github.com/google/go-github/v32/github" "github.com/ldez/ghactions" ) @@ -76,7 +76,7 @@ func parseInput(r io.Reader) Report { files := make(map[string]*LinterResult) failedLines := 0 ErrorHasOccured := false - re := regexp.MustCompile(` \[(.*)\]`) + re := regexp.MustCompile(` \[(.*)]`) for scanner.Scan() { cols := strings.Split(scanner.Text(), ":") @@ -92,7 +92,7 @@ func parseInput(r io.Reader) Report { message := strings.Split(cols[3], "] ")[1] if len(cols) == 5 { - message += ":" + cols[4] + message += ":" + cols[4] } severity := mapSeverity(re.FindStringSubmatch(cols[3])[1]) @@ -137,7 +137,7 @@ func main() { ctx := context.Background() action := ghactions.NewAction(ctx) action.OnPush(func(client *github.Client, event *github.PushEvent) error { - return handlePush(ctx, client, event, report) + return handlePush(ctx, client, report) }) if err := action.Run(); err != nil { @@ -145,7 +145,7 @@ func main() { } } -func handlePush(ctx context.Context, client *github.Client, event *github.PushEvent, report Report) error { +func handlePush(ctx context.Context, client *github.Client, report Report) error { if report.Success { return nil }