🔧 chore(workflow): 增强调试 Release Token 校验

- 输出当前 RELEASE_TOKEN 的 sha256 摘要,便于与本地成功 token 做无泄露比对
- 在发布前直接用当前 token 探测创建 Release API 并打印响应体
- 为定位 workflow 内 token 与手工 curl 结果不一致的问题提供确定性证据
This commit is contained in:
2026-05-26 15:00:12 +08:00
parent 975b7b170c
commit 13e4d1f684

View File

@@ -135,8 +135,15 @@ jobs:
GITEA_URL="${SERVER_URL%/}"
GITEA_OWNER="${REPOSITORY%%/*}"
GITEA_REPO="${REPOSITORY#*/}"
echo "RELEASE_TOKEN=$GITEA_TOKEN"
printf '%s' "$GITEA_TOKEN" | sha256sum
env | sort | grep -E '^(GITEA|GITHUB|RELEASE)_' || true
curl -sS -o /tmp/lightops-create-release-probe.json -w 'probe create release status: %{http_code}\n' \
-X POST \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d '{"tag_name":"probe-v0-1-22","target_commitish":"main","name":"probe-v0-1-22","body":"probe","draft":false,"prerelease":true}' \
"${GITEA_URL}/api/v1/repos/${GITEA_OWNER}/${GITEA_REPO}/releases" || true
cat /tmp/lightops-create-release-probe.json || true
cd lightops-src
TAG="$(cat /tmp/lightops-release-tag)"
TARGET_SHA="$(git rev-parse HEAD)"