Skip to content

Commit d8962cd

Browse files
committed
Configure access to private repos in the CI
1 parent f656c60 commit d8962cd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.gitlab-ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ default:
99
NIX_CONFIG_FILE=~/.config/nix/nix.conf
1010
mkdir -p "$(dirname "$NIX_CONFIG_FILE")"
1111
{
12-
echo "access-tokens = ${CI_SERVER_HOST}=PAT:${CI_GROUP_TOKEN}"
12+
echo "access-tokens = ${CI_SERVER_HOST}=PAT:${CI_GROUP_TOKEN} github.com=${GH_READ_METACRAFT_PRIVATE_REPOS}"
1313
} > "$NIX_CONFIG_FILE"
1414
15+
# Rewrite SSH URLs to HTTPS with token for submodule cloning
16+
# (e.g. tree-sitter-nim uses SSH URL in .gitmodules)
17+
git config --global url."https://oauth2:${GH_READ_METACRAFT_PRIVATE_REPOS}@github.com/".insteadOf "git@github.com:"
18+
git config --global url."https://oauth2:${GH_READ_METACRAFT_PRIVATE_REPOS}@github.com/".insteadOf "ssh://git@github.com/"
19+
1520
stages:
1621
- lint
1722
- build

0 commit comments

Comments
 (0)