Skip to content

Commit

Permalink
Merge branch 'main' into fix/prevent-output-env-2
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke authored Sep 20, 2022
2 parents 04346bd + ff79023 commit 933f0b6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion aqua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# https://github.com/aquaproj/aqua
registries:
- type: standard
ref: v3.50.0 # renovate: depName=aquaproj/aqua-registry
ref: v3.57.0 # renovate: depName=aquaproj/aqua-registry
packages:
- name: suzuki-shunsuke/[email protected]
- name: reviewdog/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/suzuki-shunsuke/github-comment-metadata v0.1.0
github.com/suzuki-shunsuke/go-ci-env/v3 v3.0.1
github.com/suzuki-shunsuke/go-findconfig v1.1.1
github.com/urfave/cli/v2 v2.16.2
github.com/urfave/cli/v2 v2.16.3
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
gopkg.in/yaml.v2 v2.4.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ github.com/suzuki-shunsuke/go-ci-env/v3 v3.0.1 h1:deCm9of48iwRq0Axg3ne8mx/26h3ok
github.com/suzuki-shunsuke/go-ci-env/v3 v3.0.1/go.mod h1:VmLj5u0w7Yf/IJIzZ+TWiB7mVT3pRKPMeb0Jssk7YsA=
github.com/suzuki-shunsuke/go-findconfig v1.1.1 h1:7jBTjf7RjfvRC6XNpCKCJC6y8hHVYPVVefOQHQPHRVw=
github.com/suzuki-shunsuke/go-findconfig v1.1.1/go.mod h1:u/0Zz6/GDE6G0gofzVhR9UPOIKLSUoDMjUoFWqOoVlg=
github.com/urfave/cli/v2 v2.16.2 h1:54KkXv2+tay5GSZJzuVgcE0C+A/Uzv6BsfNXH0wjU4c=
github.com/urfave/cli/v2 v2.16.2/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI=
github.com/urfave/cli/v2 v2.16.3 h1:gHoFIwpPjoyIMbJp/VFd+/vuD0dAgFK4B6DpEMFJfQk=
github.com/urfave/cli/v2 v2.16.3/go.mod h1:1CNUng3PtjQMtRzJO4FMXBQvkGtuYRxxiR9xMa7jMwI=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
Expand Down
11 changes: 6 additions & 5 deletions pkg/notifier/github/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ func (g *NotifyService) Apply(ctx context.Context, param *notifier.ParamExec) (i
template := g.client.Config.Template
var errMsgs []string

if cfg.PR.Number == 0 {
if prNumber, err := g.client.Commits.PRNumber(ctx, cfg.PR.Revision, PullRequestStateClosed); err == nil {
cfg.PR.Number = prNumber
}
}

result := parser.Parse(param.CombinedOutput)
result.ExitCode = param.ExitCode
if result.HasParseError {
Expand Down Expand Up @@ -52,11 +58,6 @@ func (g *NotifyService) Apply(ctx context.Context, param *notifier.ParamExec) (i
if err != nil {
return result.ExitCode, err
}
if cfg.PR.Number == 0 {
if prNumber, err := g.client.Commits.PRNumber(ctx, cfg.PR.Revision, PullRequestStateClosed); err == nil {
cfg.PR.Number = prNumber
}
}

logE := logrus.WithFields(logrus.Fields{
"program": "tfcmt",
Expand Down
11 changes: 6 additions & 5 deletions pkg/notifier/github/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ func (g *NotifyService) Plan(ctx context.Context, param *notifier.ParamExec) (in
template := g.client.Config.Template
var errMsgs []string

if cfg.PR.Number == 0 && cfg.PR.Revision != "" {
if prNumber, err := g.client.Commits.PRNumber(ctx, cfg.PR.Revision, PullRequestStateOpen); err == nil {
cfg.PR.Number = prNumber
}
}

result := parser.Parse(param.CombinedOutput)
result.ExitCode = param.ExitCode
if result.HasParseError {
Expand Down Expand Up @@ -56,11 +62,6 @@ func (g *NotifyService) Plan(ctx context.Context, param *notifier.ParamExec) (in
if err != nil {
return result.ExitCode, err
}
if cfg.PR.Number == 0 && cfg.PR.Revision != "" {
if prNumber, err := g.client.Commits.PRNumber(ctx, cfg.PR.Revision, PullRequestStateOpen); err == nil {
cfg.PR.Number = prNumber
}
}

logE := logrus.WithFields(logrus.Fields{
"program": "tfcmt",
Expand Down

0 comments on commit 933f0b6

Please sign in to comment.