From 90d20375637ecfe321af9df85217fffce1971ed9 Mon Sep 17 00:00:00 2001 From: jake Date: Tue, 11 Nov 2025 16:27:26 -0500 Subject: [PATCH] adding log_level option --- action.yaml | 7 ++++--- main.go | 12 +++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/action.yaml b/action.yaml index d331acc..8f739da 100644 --- a/action.yaml +++ b/action.yaml @@ -5,9 +5,10 @@ inputs: description: "path to docker compose file" required: true default: "compose.yaml" - ignore: - description: "checks to ignore (doesn't work yet)" + show: + description: "what level of issues to show (all|fatal)" required: false + default: "all" outputs: report: description: "results of the scan" @@ -16,4 +17,4 @@ runs: image: Dockerfile env: COMPOSE_FILE_PATH: ${{ inputs.path }} - IGNORED_CHECKS: ${{ inputs.ignore }} + LOG_LEVEL: ${{ inputs.show }} diff --git a/main.go b/main.go index 79717e1..7c082c7 100644 --- a/main.go +++ b/main.go @@ -96,10 +96,20 @@ func main() { issues = append(issues, rprt) } + //this is better printing, it should probably group up the port issues in a better printing. Not sure how + lvl := os.Getenv("LOG_LEVEL") for _, p := range issues { + fmt.Println() + fmt.Println("----------------------------------------------------------------------------") fmt.Println(p.Name) for _, x := range p.Issues { - fmt.Println(*x) + if lvl == "all" { + fmt.Printf("\tsafe: %t\n\tlevel: %s\n\tMessages:\n\t\t%s\n\n", x.Safe, x.Level, strings.Join(x.Messages, "\n\t\t")) + } else if lvl == "fatal" { + if x.Level == issue.FATAL { + fmt.Printf("\tsafe: %t\n\tlevel: %s\n\tMessages:\n\t\t%s\n\n", x.Safe, x.Level, strings.Join(x.Messages, "\n\t\t")) + } + } } } }