Skip to content

Commit

Permalink
feat(cmd): Invert condition & fix error annotation
Browse files Browse the repository at this point in the history
Signed-off-by: Cezar Craciunoiu <cezar.craciunoiu@gmail.com>
  • Loading branch information
craciunoiuc committed Dec 12, 2023
1 parent cdca295 commit 428f15b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/governctl/pr/check/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (opts *Patch) Run(cmd *cobra.Command, args []string) error {
tableprinter.WithOutputFormatFromString(opts.Output),
}

if !kitcfg.G[config.Config](ctx).NoRender {
if kitcfg.G[config.Config](ctx).NoRender {
topts = append(topts, tableprinter.WithMaxWidth(10000))
} else {
topts = append(topts, tableprinter.WithMaxWidth(iostreams.G(ctx).TerminalWidth()))
Expand Down Expand Up @@ -174,7 +174,7 @@ func (opts *Patch) Run(cmd *cobra.Command, args []string) error {
// Set an annotations on the PR if run in a GitHub Actions context.
// See: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message
if os.Getenv("GITHUB_ACTIONS") == "true" && len(note.File) > 0 && note.Line > 0 {
fmt.Printf("echo ::%s file=%s,line=%d::%s", note.Level, note.File, note.Line, note.Message)
fmt.Printf("::%s file=%s,line=%d,title=%s::%s\n", note.Level, note.File, note.Line, note.Type, note.Message)
}
}
}
Expand Down

0 comments on commit 428f15b

Please sign in to comment.