Skip to content

Latest commit

 

History

History
36 lines (32 loc) · 1006 Bytes

gitlab-ci.md

File metadata and controls

36 lines (32 loc) · 1006 Bytes

GitLab CI

Install the package from the repository and publish a native Code Quality artifact. Start with --fail-on none, then raise the gate after teams have reviewed existing workflows.

stages:
  - review

infra-review:
  stage: review
  image: python:3.12-slim
  before_script:
    - apt-get update && apt-get install -y --no-install-recommends git
    - pip install "git+https://github.com/semx/mr-rca-toolkit.git"
  script:
    - >-
      mr-rca scan .
      --base "$CI_MERGE_REQUEST_DIFF_BASE_SHA"
      --head "$CI_COMMIT_SHA"
      --environment production
      --format gitlab
      --output gl-code-quality-report.json
      --fail-on high
  artifacts:
    when: always
    reports:
      codequality: gl-code-quality-report.json
    paths:
      - gl-code-quality-report.json

If the target environment varies, populate --environment from a protected CI variable or derive it in a preceding job. Do not let an untrusted merge request choose a less strict environment value.