Commit cc9e22b8 authored by Totara-thib's avatar Totara-thib
Browse files

chore: put sarif_codeclimate version in a variable

parent b8f01cf6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -50,6 +50,8 @@ customize its behavior.
|`GITLAB_COMMENT_REPORTER` | Posts Mega-Linter results summary in the comments of the related merge request ([⚠️ GitLab API access require](https://oxsecurity.github.io/megalinter/latest/reporters/GitlabCommentReporter/#configuration){:target="_blank"}) | `true` |
| `DISABLE_LINTERS` | Comma separated list of linters to be disabled | ` ` |
| `IMAGE_TAG` | The default tag for the docker image | `v6.18.0` |
| `SARIF_CODECLIMATE_VERSION` | Version tag of the [sarif-codeclimate](https://www.npmjs.com/package/sarif-codeclimate) package to convert sarif reports | `v6.18.0` |


## Optimize MegaLinter

+4 −1
Original line number Diff line number Diff line
@@ -39,6 +39,9 @@ mega_linter:
    CONVERTED_OUTPUT_FOLDER: "converted-xml.report"
    # Image tag of the MegaLinter image used in this job
    IMAGE_TAG: "v6.18.0"
    # Version tag of the sarif-codeclimate package to convert sarif reports
    # https://www.npmjs.com/package/sarif-codeclimate
    SARIF_CODECLIMATE_VERSION: "1.0.2"
  script:
    - FAILED=false
    - |
@@ -52,7 +55,7 @@ mega_linter:
    - mkdir ${CI_PROJECT_DIR}/${CONVERTED_OUTPUT_FOLDER}
    - cp ${CI_PROJECT_DIR}/${REPORT_OUTPUT_FOLDER}/megalinter-report.sarif ${CI_PROJECT_DIR}/${CONVERTED_OUTPUT_FOLDER}
    - cd ${CI_PROJECT_DIR}/${CONVERTED_OUTPUT_FOLDER}
    - npx -y sarif-codeclimate@1.0.2 -i megalinter-report.sarif -o code-climate.json
    - npx -y sarif-codeclimate@${SARIF_CODECLIMATE_VERSION} -i megalinter-report.sarif -o code-climate.json
    - if [ "$FAILED" = true ]; then
    -   exit 1
    - fi