Skip to content

Commit

Permalink
feat(cmd): Show hash & do not print table in actions
Browse files Browse the repository at this point in the history
Signed-off-by: Cezar Craciunoiu <[email protected]>
  • Loading branch information
craciunoiuc committed Dec 12, 2023
1 parent 16215a8 commit 902ca00
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cmd/governctl/pr/check/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (opts *Patch) Run(cmd *cobra.Command, args []string) error {
note.File,
note.Line,
note.Type,
fmt.Sprintf("%s:%d-%d: %s", note.File, note.Line, note.Line, note.Message),
fmt.Sprintf("(%s) %s:%d-%d: %s", patch.Hash[0:7], note.File, note.Line, note.Line, note.Message),
)
}
}
Expand Down Expand Up @@ -208,9 +208,11 @@ func (opts *Patch) Run(cmd *cobra.Command, args []string) error {
defer iostreams.G(ctx).StopPager()
}

err = table.Render(iostreams.G(ctx).Out)
if err != nil {
return err
if os.Getenv("GITHUB_ACTIONS") == "" {
err = table.Render(iostreams.G(ctx).Out)
if err != nil {
return err
}
}

if errors > 0 || warnings > 0 {
Expand Down

0 comments on commit 902ca00

Please sign in to comment.