Merge branch 'set-secret-detection-config-1' into 'main'

Configure Secret Detection in `.gitlab-ci.yml`, creating this file if it does not already exist

See merge request cbm343e/doi2dataset!1
This commit is contained in:
Alexander Minges 2025-07-08 15:35:03 +02:00
commit 34317dd03b

View file

@ -1,26 +1,28 @@
# GitLab CI/CD pipeline for doi2dataset # You can override the included template(s) by including variable overrides
# Compatible with GitLab v18.1.1 # SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/user/application_security/secret_detection/pipeline/configure
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
stages: stages:
- test - test
- secret-detection
variables: variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache: cache:
paths: paths:
- .cache/pip/ - ".cache/pip/"
- .venv/ - ".venv/"
test: test:
stage: test stage: test
image: python:3 image: python:3
before_script: before_script:
- python -m pip install --upgrade pip - python -m pip install --upgrade pip
- pip install -r requirements.txt - pip install -r requirements.txt
- pip install -r requirements-dev.txt - pip install -r requirements-dev.txt
script: script:
- pytest - pytest
artifacts: artifacts:
reports: reports:
junit: junit.xml junit: junit.xml
@ -28,9 +30,13 @@ test:
coverage_format: cobertura coverage_format: cobertura
path: coverage.xml path: coverage.xml
paths: paths:
- htmlcov/ - htmlcov/
expire_in: 1 week expire_in: 1 week
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' coverage: "/(?i)total.*? (100(?:\\.0+)?\\%|[1-9]?\\d(?:\\.\\d+)?\\%)$/"
only: only:
- branches - branches
- merge_requests - merge_requests
secret_detection:
stage: secret-detection
include:
- template: Security/Secret-Detection.gitlab-ci.yml