From 4dd87a09611fdbce21de139c0558d83d1e94ac07 Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Wed, 13 Nov 2024 12:41:01 +0100 Subject: [PATCH] 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. --- Pre-Commit-Go.gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Pre-Commit-Go.gitlab-ci.yml b/Pre-Commit-Go.gitlab-ci.yml index 7cc7dc5..6105cb6 100644 --- a/Pre-Commit-Go.gitlab-ci.yml +++ b/Pre-Commit-Go.gitlab-ci.yml @@ -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 -- 2.52.0