Skip to content

Commit

Permalink
feat(cmd): Add file and lines in message for verbosity
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 428f15b commit 16215a8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/governctl/pr/check/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,13 @@ 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("::%s file=%s,line=%d,title=%s::%s\n", note.Level, note.File, note.Line, note.Type, note.Message)
fmt.Printf("::%s file=%s,line=%d,title=%s::%s\n",
note.Level,
note.File,
note.Line,
note.Type,
fmt.Sprintf("%s:%d-%d: %s", note.File, note.Line, note.Line, note.Message),
)
}
}
}
Expand Down

0 comments on commit 16215a8

Please sign in to comment.