fix(release cleanup): 改用 GITEA_TOKEN 呼叫 API
This commit is contained in:
+5
-5
@@ -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 "取得成品資訊"
|
||||
|
||||
Reference in New Issue
Block a user