fix: 修复 Gitea 发布工作流在 fork/镜像仓库中的兼容性问题 #1

Merged
Eeveid merged 24 commits from zhilv/lightOps:main into main 2026-05-28 18:53:16 +08:00
Showing only changes of commit b4001f5e12 - Show all commits

View File

@@ -12,6 +12,7 @@ jobs:
- name: 检出代码
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GIT_TERMINAL_PROMPT: "0"
run: |
set -eux
SERVER_URL="${GITHUB_SERVER_URL:-${GITEA_SERVER_URL:-https://gitea.kmux.cn}}"
@@ -35,13 +36,12 @@ jobs:
rm -rf lightops-src
if [ -n "${GITEA_TOKEN:-}" ]; then
AUTH_HEADER="Authorization: Basic $(printf 'oauth2:%s' "$GITEA_TOKEN" | base64 | tr -d '\n')"
git -c http.extraHeader="$AUTH_HEADER" clone "$CLONE_URL" lightops-src
git -c http.extraHeader="$AUTH_HEADER" clone --branch "$TAG" --depth 1 --single-branch "$CLONE_URL" lightops-src
else
git clone "$CLONE_URL" lightops-src
git clone --branch "$TAG" --depth 1 --single-branch "$CLONE_URL" lightops-src
fi
cd lightops-src
git fetch --tags --force
git checkout "$TAG"
git rev-parse --verify HEAD
- name: 安装系统依赖
run: |