From 5d96fcab11d29ff25e7a1b1bda71137311a79441 Mon Sep 17 00:00:00 2001 From: 44r0n7 <44r0n7+gitea@pm.me> Date: Tue, 30 Dec 2025 11:58:09 -0500 Subject: [PATCH] Use RELEASE_TOKEN secret for releases --- .gitea/workflows/release.yml | 12 ++++++------ docs/RELEASING.md | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index c238505..be7ce63 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -43,11 +43,11 @@ jobs: - name: Upload release assets env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} run: | set -euo pipefail - if [ -z "${GITEA_TOKEN:-}" ]; then - echo "GITEA_TOKEN secret is required to upload release assets." + if [ -z "${RELEASE_TOKEN:-}" ]; then + echo "RELEASE_TOKEN secret is required to upload release assets." exit 1 fi TAG="${GITHUB_REF_NAME:-${GITEA_REF_NAME:-unknown}}" @@ -57,7 +57,7 @@ jobs: fi REPO="${GITHUB_REPOSITORY}" - release_json=$(curl -sS -H "Authorization: token ${GITEA_TOKEN}" \ + release_json=$(curl -sS -H "Authorization: token ${RELEASE_TOKEN}" \ "${API_URL}/repos/${REPO}/releases/tags/${TAG}") release_id=$(python3 - <<'PY' import json, sys @@ -76,7 +76,7 @@ print(json.dumps({ })) PY ) - release_json=$(curl -sS -H "Authorization: token ${GITEA_TOKEN}" \ + release_json=$(curl -sS -H "Authorization: token ${RELEASE_TOKEN}" \ -H "Content-Type: application/json" \ -d "$create_payload" \ "${API_URL}/repos/${REPO}/releases") @@ -90,7 +90,7 @@ PY for file in dist/*.tar.gz; do name=$(basename "$file") - curl -sS -H "Authorization: token ${GITEA_TOKEN}" \ + curl -sS -H "Authorization: token ${RELEASE_TOKEN}" \ -H "Content-Type: application/octet-stream" \ --data-binary @"$file" \ "${API_URL}/repos/${REPO}/releases/${release_id}/assets?name=${name}" diff --git a/docs/RELEASING.md b/docs/RELEASING.md index d872b18..9bfba17 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -5,7 +5,7 @@ This repo includes a Gitea Actions workflow that builds Linux binaries for ## One-time setup (Gitea Actions) 1) Create a personal access token with repo write access. -2) Add it to the repo secrets as `GITEA_TOKEN`. +2) Add it to the repo secrets as `RELEASE_TOKEN`. ## Release steps 1) Update `CHANGELOG.md`.