From f87cf3fd2093ab13747e787df88b498ef4e999cd Mon Sep 17 00:00:00 2001 From: voson Date: Wed, 18 Mar 2026 15:27:05 +0800 Subject: [PATCH] fix: store RELEASE_TOKEN as raw value, not base64 Gitea Actions secrets API stores the data field as-is, base64 encoding caused CI to use the encoded string as the token, resulting in 401. Made-with: Cursor --- .gitea/workflows/secrets.yml | 6 +++--- scripts/setup-gitea-actions.sh | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/secrets.yml b/.gitea/workflows/secrets.yml index f156cef..b789598 100644 --- a/.gitea/workflows/secrets.yml +++ b/.gitea/workflows/secrets.yml @@ -227,7 +227,7 @@ jobs: needs: [version, probe-runners, check] if: needs.probe-runners.outputs.has_linux == 'true' runs-on: debian - timeout-minutes: 10 + timeout-minutes: 1 continue-on-error: true steps: - name: 安装依赖 @@ -277,7 +277,7 @@ jobs: needs: [version, probe-runners, check] if: needs.probe-runners.outputs.has_macos == 'true' runs-on: darwin-arm64 - timeout-minutes: 10 + timeout-minutes: 1 continue-on-error: true steps: - name: 安装依赖 @@ -325,7 +325,7 @@ jobs: needs: [version, probe-runners, check] if: needs.probe-runners.outputs.has_windows == 'true' runs-on: windows - timeout-minutes: 10 + timeout-minutes: 1 continue-on-error: true steps: - name: 安装依赖 diff --git a/scripts/setup-gitea-actions.sh b/scripts/setup-gitea-actions.sh index dcfd0dc..c0327be 100755 --- a/scripts/setup-gitea-actions.sh +++ b/scripts/setup-gitea-actions.sh @@ -109,11 +109,10 @@ echo "" # 1. 创建 Secret: RELEASE_TOKEN echo "1. 创建 Secret: RELEASE_TOKEN" -encoded=$(echo -n "$GITEA_TOKEN" | base64) resp=$(curl -s -w "\n%{http_code}" -X PUT \ -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ - -d "{\"data\":\"${encoded}\"}" \ + -d "{\"data\":\"${GITEA_TOKEN}\"}" \ "${API_BASE}/repos/${OWNER}/${REPO}/actions/secrets/RELEASE_TOKEN") http_code=$(echo "$resp" | tail -n1) body=$(echo "$resp" | sed '$d')