From 13e4d1f684e0a426473d524d6220998d01865a5e Mon Sep 17 00:00:00 2001 From: zhilv Date: Tue, 26 May 2026 15:00:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore(workflow):=20=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E8=B0=83=E8=AF=95=20Release=20Token=20=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 输出当前 RELEASE_TOKEN 的 sha256 摘要,便于与本地成功 token 做无泄露比对 - 在发布前直接用当前 token 探测创建 Release API 并打印响应体 - 为定位 workflow 内 token 与手工 curl 结果不一致的问题提供确定性证据 --- .gitea/workflows/release.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index bb9adf3..bc5df9c 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -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)"