Private
Public Access
1
0

ci: Use GITEA_TOKEN fallback for API archive checkout
All checks were successful
Build .deb Package / build-and-package (push) Successful in 2m16s

- GITHUB_TOKEN may not be injected in linux:host mode
- Use GITEA_TOKEN from runner environment as fallback
- API archive download with Authorization header is proven working
- Added GITEA_TOKEN to act-runner systemd service environment
This commit is contained in:
2026-04-24 02:54:18 +00:00
parent 9c924a204c
commit fa5456c2b8

View File

@ -23,9 +23,10 @@ jobs:
- name: Checkout repository
run: |
# Use Gitea API archive download (avoids git auth issues with private repos)
# Token auth works reliably in HTTP headers, not in git URLs
curl -sf -H "Authorization: token ${GITHUB_TOKEN}" \
# Use Gitea API archive download with token auth
# GITHUB_TOKEN may not be injected in linux:host mode; fall back to GITEA_TOKEN
TOKEN="${GITHUB_TOKEN:-$GITEA_TOKEN}"
curl -sf -H "Authorization: token ${TOKEN}" \
"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