Private
Public Access
1
0

ci: Fix git clone with GITHUB_TOKEN for private repo auth
Some checks failed
Build .deb Package / build-and-package (push) Failing after 1s

- Private repos require authentication for git clone
- Inject GITHUB_TOKEN into clone URL: http://echo:{GITHUB_TOKEN}@host/repo.git
- Kill stuck clone processes on runner before new build
This commit is contained in:
2026-04-24 02:17:51 +00:00
parent 038c168472
commit c9f9a59ce6

View File

@ -23,8 +23,11 @@ jobs:
- name: Checkout repository - name: Checkout repository
run: | run: |
rm -rf .git # Use GITHUB_TOKEN for authenticated clone
git clone "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" . GIT_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git"
# Inject token into URL for private repos
AUTH_URL="${GIT_URL/http:\/\//http://echo:${GITHUB_TOKEN}@}"
git clone "${AUTH_URL}" .
git checkout "$GITHUB_SHA" git checkout "$GITHUB_SHA"
- name: Ensure Rust toolchain - name: Ensure Rust toolchain