run-pre-commit: stage: .pre image: unbound/pre-commit:v0.2.4@sha256:aec8d8b1e4f3fe2696e408d48cbe580e2a151908af93f88828d95b65c97ca8db variables: PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit GOPRIVATE: gitlab.com/unboundsoftware cache: - key: files: - .pre-commit-config.yaml paths: - ${PRE_COMMIT_HOME} before_script: - echo -e "machine gitlab.com\nlogin gitlab-ci-token\npassword ${CI_JOB_TOKEN}" > ~/.netrc script: - pre-commit run --all-files