fix(release cleanup): 改用 GITEA_TOKEN 呼叫 API

This commit is contained in:
2026-06-25 10:58:56 +00:00
parent 034c1ce67b
commit 0e91eb6cf3
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -12,5 +12,5 @@ runs:
env:
GITEA_SERVER_URL: ${{ gitea.server_url }}
GITEA_REPOSITORY: ${{ gitea.repository }}
RUNNER_TOKEN: ${{ gitea.token }}
GITEA_TOKEN: ${{ gitea.token }}
KEEP_COUNT: ${{ inputs.keep_count }}
+5 -5
View File
@@ -79,17 +79,17 @@ require_value "GITEA_REPOSITORY" "$GITEA_REPOSITORY"
require_value "KEEP_COUNT" "$KEEP_COUNT"
require_integer "KEEP_COUNT" "$KEEP_COUNT"
if is_empty_or_null "${RUNNER_TOKEN:-}"; then
warn "RUNNER_TOKEN is empty; release API calls will be anonymous"
if is_empty_or_null "${GITEA_TOKEN:-}"; then
warn "GITEA_TOKEN is empty; release API calls will be anonymous"
else
info "RUNNER_TOKEN=[redacted]"
info "GITEA_TOKEN=[redacted]"
fi
release_api_url="$GITEA_SERVER_URL/api/v1/repos/$GITEA_REPOSITORY/releases"
auth_header=()
if ! is_empty_or_null "${RUNNER_TOKEN:-}"; then
auth_header=(-H "Authorization: token $RUNNER_TOKEN")
if ! is_empty_or_null "${GITEA_TOKEN:-}"; then
auth_header=(-H "Authorization: token $GITEA_TOKEN")
fi
section "取得成品資訊"