fix: store RELEASE_TOKEN as raw value, not base64
Some checks failed
Secrets CLI - Build & Release / 版本 & Release (push) Successful in 2s
Secrets CLI - Build & Release / 质量检查 (fmt / clippy / test) (push) Successful in 23s
Secrets CLI - Build & Release / Build (x86_64-unknown-linux-musl) (push) Has been skipped
Secrets CLI - Build & Release / Build (aarch64-apple-darwin) (push) Has been skipped
Secrets CLI - Build & Release / 探测 Runner (push) Successful in 1s
Secrets CLI - Build & Release / 通知 (push) Has been cancelled
Secrets CLI - Build & Release / Build (x86_64-pc-windows-msvc) (push) Has been cancelled
Some checks failed
Secrets CLI - Build & Release / 版本 & Release (push) Successful in 2s
Secrets CLI - Build & Release / 质量检查 (fmt / clippy / test) (push) Successful in 23s
Secrets CLI - Build & Release / Build (x86_64-unknown-linux-musl) (push) Has been skipped
Secrets CLI - Build & Release / Build (aarch64-apple-darwin) (push) Has been skipped
Secrets CLI - Build & Release / 探测 Runner (push) Successful in 1s
Secrets CLI - Build & Release / 通知 (push) Has been cancelled
Secrets CLI - Build & Release / Build (x86_64-pc-windows-msvc) (push) Has been cancelled
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
This commit is contained in:
@@ -227,7 +227,7 @@ jobs:
|
|||||||
needs: [version, probe-runners, check]
|
needs: [version, probe-runners, check]
|
||||||
if: needs.probe-runners.outputs.has_linux == 'true'
|
if: needs.probe-runners.outputs.has_linux == 'true'
|
||||||
runs-on: debian
|
runs-on: debian
|
||||||
timeout-minutes: 10
|
timeout-minutes: 1
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- name: 安装依赖
|
- name: 安装依赖
|
||||||
@@ -277,7 +277,7 @@ jobs:
|
|||||||
needs: [version, probe-runners, check]
|
needs: [version, probe-runners, check]
|
||||||
if: needs.probe-runners.outputs.has_macos == 'true'
|
if: needs.probe-runners.outputs.has_macos == 'true'
|
||||||
runs-on: darwin-arm64
|
runs-on: darwin-arm64
|
||||||
timeout-minutes: 10
|
timeout-minutes: 1
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- name: 安装依赖
|
- name: 安装依赖
|
||||||
@@ -325,7 +325,7 @@ jobs:
|
|||||||
needs: [version, probe-runners, check]
|
needs: [version, probe-runners, check]
|
||||||
if: needs.probe-runners.outputs.has_windows == 'true'
|
if: needs.probe-runners.outputs.has_windows == 'true'
|
||||||
runs-on: windows
|
runs-on: windows
|
||||||
timeout-minutes: 10
|
timeout-minutes: 1
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
steps:
|
steps:
|
||||||
- name: 安装依赖
|
- name: 安装依赖
|
||||||
|
|||||||
@@ -109,11 +109,10 @@ echo ""
|
|||||||
|
|
||||||
# 1. 创建 Secret: RELEASE_TOKEN
|
# 1. 创建 Secret: RELEASE_TOKEN
|
||||||
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 \
|
resp=$(curl -s -w "\n%{http_code}" -X PUT \
|
||||||
-H "Authorization: token $GITEA_TOKEN" \
|
-H "Authorization: token $GITEA_TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"data\":\"${encoded}\"}" \
|
-d "{\"data\":\"${GITEA_TOKEN}\"}" \
|
||||||
"${API_BASE}/repos/${OWNER}/${REPO}/actions/secrets/RELEASE_TOKEN")
|
"${API_BASE}/repos/${OWNER}/${REPO}/actions/secrets/RELEASE_TOKEN")
|
||||||
http_code=$(echo "$resp" | tail -n1)
|
http_code=$(echo "$resp" | tail -n1)
|
||||||
body=$(echo "$resp" | sed '$d')
|
body=$(echo "$resp" | sed '$d')
|
||||||
|
|||||||
Reference in New Issue
Block a user