From d8cbb0994155161f19865d273459de77fd2dd92f Mon Sep 17 00:00:00 2001 From: Nicolas Vuillamy Date: Mon, 19 Aug 2024 14:28:42 +0200 Subject: [PATCH] Count number of errors in Grype (#3906) * [automation] Auto-update linters version, help and documentation * [MegaLinter] Apply linters fixes * Count number of errors in Grype * Doc * fix --------- Co-authored-by: nvuillam --- CHANGELOG.md | 1 + docs/reporters/ApiReporter.md | 11 +++++++++++ .../descriptors/repository.megalinter-descriptor.yml | 2 ++ 3 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba830c9d419..700a3629ff6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l - Linters enhancements - [bandit](https://megalinter.io/latest/descriptors/python_bandit/) Call bandit with quiet mode to generate less logs + - [grype](https://megalinter.io/latest/descriptors/repository_grype/) Count number of errors returned by Grype - [yamllint](https://megalinter.io/latest/descriptors/yaml_yamllint) Fix yamllint default format to avoid special characters or GitHub sections in text logs - Reporters diff --git a/docs/reporters/ApiReporter.md b/docs/reporters/ApiReporter.md index 70ae7ecb7e1..471a154385d 100644 --- a/docs/reporters/ApiReporter.md +++ b/docs/reporters/ApiReporter.md @@ -292,6 +292,17 @@ _Example with GitHub Workflow:_ ![](../assets/images/grafana-config-13bis.jpg) +```yaml + API_REPORTER: true + API_REPORTER_URL: ${{ secrets.API_REPORTER_URL }} + API_REPORTER_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_BASIC_AUTH_USERNAME }} + API_REPORTER_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_BASIC_AUTH_PASSWORD }} + API_REPORTER_METRICS_URL: ${{ secrets.API_REPORTER_METRICS_URL }} + API_REPORTER_METRICS_BASIC_AUTH_USERNAME: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_USERNAME }} + API_REPORTER_METRICS_BASIC_AUTH_PASSWORD: ${{ secrets.API_REPORTER_METRICS_BASIC_AUTH_PASSWORD }} + API_REPORTER_DEBUG: false +``` + ### Download MegaLinter dashboards Download all MegaLinter Dashboard JSON files from [this MegaLinter repo folder](https://github.com/oxsecurity/megalinter/tree/main/docs/grafana) diff --git a/megalinter/descriptors/repository.megalinter-descriptor.yml b/megalinter/descriptors/repository.megalinter-descriptor.yml index 370b8f0e354..7e5bbfd6426 100644 --- a/megalinter/descriptors/repository.megalinter-descriptor.yml +++ b/megalinter/descriptors/repository.megalinter-descriptor.yml @@ -286,6 +286,8 @@ linters: - --output - sarif cli_version_arg_name: version + cli_lint_errors_count: regex_count + cli_lint_errors_regex: "(Low|Medium|High|Critical)" examples: - "grype dir:." downgraded_version: true