test-run-spellcheck:
  image: ubuntu:noble
  tags:
    - gitlab-org-docker
  stage: test
  interruptible: true
  rules:
    - if: $CI_PROJECT_PATH != "cryptsetup/cryptsetup"
      when: never
    - if: $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /v2\..\.x$/
  artifacts:
    name: "spellcheck-$CI_COMMIT_REF_NAME"
    paths:
      - _spellcheck
  before_script:
    - apt-get -y update --fix-missing
    - apt-get -y install git lintian codespell
  script:
    - echo "Running spellcheck"
    - .gitlab/ci/spellcheck
