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:
@@ -3,11 +3,14 @@ run-pre-commit:
|
|||||||
image: unbound/pre-commit@sha256:596abf501d5ac878534b76f19d19ec5c952f1f362ad92d611172072ef5d483d5
|
image: unbound/pre-commit@sha256:596abf501d5ac878534b76f19d19ec5c952f1f362ad92d611172072ef5d483d5
|
||||||
variables:
|
variables:
|
||||||
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
|
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
|
||||||
|
GOPRIVATE: gitlab.com/unboundsoftware
|
||||||
cache:
|
cache:
|
||||||
- key:
|
- key:
|
||||||
files:
|
files:
|
||||||
- .pre-commit-config.yaml
|
- .pre-commit-config.yaml
|
||||||
paths:
|
paths:
|
||||||
- ${PRE_COMMIT_HOME}
|
- ${PRE_COMMIT_HOME}
|
||||||
|
before_script:
|
||||||
|
- echo -e "machine gitlab.com\nlogin gitlab-ci-token\npassword ${CI_JOB_TOKEN}" > ~/.netrc
|
||||||
script:
|
script:
|
||||||
- pre-commit run --all-files
|
- pre-commit run --all-files
|
||||||
|
|||||||
Reference in New Issue
Block a user