ci: update pre-commit configuration for GitLab CI

Add GOPRIVATE environment variable for private repos and 
create a .netrc file in the before_script to enable 
authentication with GitLab. These changes ensure that 
private repositories can be accessed during the CI 
pipeline, improving the build process.
This commit is contained in:
2024-11-13 12:41:01 +01:00
parent a35fb56d45
commit 4dd87a0961
+3
View File
@@ -3,11 +3,14 @@ run-pre-commit:
image: unbound/pre-commit@sha256:596abf501d5ac878534b76f19d19ec5c952f1f362ad92d611172072ef5d483d5
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