Skip to content

Commit 2addd46

Browse files
committed
fix: error in the ci relative to token
1 parent 154f163 commit 2addd46

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,14 @@ jobs:
5555
python3 -m pip install --cache-dir .pip-cache -r requirements.txt
5656
5757
- name: Clone configured repos
58+
env:
59+
ORG_READ_TOKEN: ${{ secrets.ACTION_TOKEN }}
5860
run: |
5961
mkdir -p /root/.ssh
6062
ssh-keyscan -H github.com >> /root/.ssh/known_hosts
6163
python3 - <<'PY'
6264
from pathlib import Path
65+
import os
6366
import subprocess
6467
6568
import yaml
@@ -79,9 +82,17 @@ jobs:
7982
name = repository["name"]
8083
ref = repository.get("ref")
8184
target = repos_root / name
82-
remote = f"git@github.com:{owner}/{name}.git"
85+
token = os.environ.get("ORG_READ_TOKEN", "").strip()
86+
if token:
87+
remote = f"https://x-access-token:{token}@github.com/{owner}/{name}.git"
88+
else:
89+
remote = f"git@github.com:{owner}/{name}.git"
90+
91+
clone = subprocess.run(["git", "clone", remote, str(target)], check=False)
92+
if clone.returncode != 0:
93+
print(f"[WARN] Could not clone {owner}/{name}. Skipping this repository.")
94+
continue
8395
84-
subprocess.run(["git", "clone", remote, str(target)], check=True)
8596
if ref:
8697
checkout = subprocess.run(["git", "-C", str(target), "checkout", ref], check=False)
8798
if checkout.returncode != 0:

0 commit comments

Comments
 (0)