Skip to main content

MegaLinter component

Runs MegaLinter through the official container entrypoint and publishes the megalinter-reports folder as a job artifact.

include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/megalinter@stable
inputs:
stage: lint
validate-all-codebase: false

Inputs

  • name: job name. Defaults to megalinter.
  • stage: job stage. Defaults to lint.
  • image: pinned MegaLinter image. Defaults to ghcr.io/oxsecurity/megalinter:v9.4.0.
  • path: directory to scan. Defaults to $CI_PROJECT_DIR.
  • validate-all-codebase: set VALIDATE_ALL_CODEBASE for MegaLinter. Defaults to false.
  • disable-errors: set DISABLE_ERRORS for report-only runs. Defaults to false.
  • allow-failure: GitLab allow_failure. Defaults to false.
  • parallel-process-number: limits MegaLinter parallelism via PARALLEL_PROCESS_NUMBER. Defaults to 4.
  • needs, tags, rules: standard GitLab job controls.

Inputs

NameDescriptionDefaultType
------------
allow-failureShould the pipeline continue if MegaLinter fails?falseboolean
disable-errorsKeep the job green while still publishing reports.falseboolean
imagePinned MegaLinter image to run.ghcr.io/oxsecurity/megalinter:v9.4.0string
nameName for the MegaLinter job.megalinterstring
needsThe jobs that this job depends on.[]array
parallel-process-numberMaximum number of linters MegaLinter may run in parallel.4number
pathPath MegaLinter should scan.$CI_PROJECT_DIRstring
rulesThe rules that control when the MegaLinter job runs.[{"if":"$CI_PIPELINE_SOURCE == \"schedule\"","when":"never"},{"if":"$CI_PIPELINE_SOURCE == \"merge_request_event\"","when":"on_success"},{"when":"on_success"}]array
stageThe pipeline stage that the job belongs to.lintstring
tagsThe runners that this job depends on.[]array
validate-all-codebaseValidate the full codebase instead of only changed files.falseboolean