ci: Use Gitea API archive download instead of git clone
Some checks failed
Build .deb Package / build-and-package (push) Failing after 1s
Some checks failed
Build .deb Package / build-and-package (push) Failing after 1s
- git clone with token-in-URL doesn't work for private repos in Gitea - Use API archive endpoint with Authorization header instead - curl archive tarball, extract with --strip-components=1 - More reliable than git URL auth for self-hosted runners
This commit is contained in:
@ -23,10 +23,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
run: |
|
run: |
|
||||||
# Use internal Gitea URL with GITHUB_TOKEN for auth
|
# Use Gitea API archive download (avoids git auth issues with private repos)
|
||||||
# GITHUB_SERVER_URL may point to unreachable external domain
|
# Token auth works reliably in HTTP headers, not in git URLs
|
||||||
git clone "http://echo:${GITHUB_TOKEN}@192.168.2.189:3000/${GITHUB_REPOSITORY}.git" .
|
curl -sf -H "Authorization: token ${GITHUB_TOKEN}" \
|
||||||
git checkout "$GITHUB_SHA"
|
"http://192.168.2.189:3000/api/v1/repos/${GITHUB_REPOSITORY}/archive/${GITHUB_SHA}.tar.gz" \
|
||||||
|
-o repo.tar.gz
|
||||||
|
tar xzf repo.tar.gz --strip-components=1
|
||||||
|
rm repo.tar.gz
|
||||||
|
|
||||||
- name: Ensure Rust toolchain
|
- name: Ensure Rust toolchain
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Reference in New Issue
Block a user