release: automatisches gitea.token statt manuellem Secret
CI / test (push) Successful in 12m56s

This commit is contained in:
2026-06-24 12:58:37 +00:00
parent 106bb61842
commit 473a754357
+11 -6
View File
@@ -9,7 +9,7 @@ name: Release Images
# - dtrack-http amd64 ("nicht Mac" / Intel)
# - dtrack-http arm64 (Apple Silicon Mac)
#
# Spiegelt den Godforge/deploy.yml-Stil (host-Runner, curl+jq, secrets.GITEATOKEN).
# Auth ueber das automatische Actions-Token (gitea.token) -- kein Secret noetig.
# Hinweis: braucht das buildx-Plugin und privilegiertes QEMU-binfmt fuer arm64.
# nodejs ist noetig, weil actions/checkout eine Node-Action ist.
@@ -51,22 +51,27 @@ jobs:
docker buildx inspect --bootstrap
- name: Build, save & attach
env:
# Automatisches, schreibberechtigtes Token des Laufs.
TOKEN: ${{ gitea.token }}
run: |
set -eu
TAG="${{ steps.vars.outputs.tag }}"
REPO="${{ gitea.repository }}"
API="https://git.sithies.de/api/v1/repos/${REPO}/releases"
AUTH="Authorization: token ${{ secrets.GITEATOKEN }}"
AUTH="Authorization: token ${TOKEN}"
# Release-Lookup mit Diagnose (privates Repo -> Auth noetig).
# Release-Lookup mit Diagnose.
HTTP=$(curl -s -o /tmp/rel.json -w "%{http_code}" "${API}/tags/${TAG}" -H "$AUTH")
REL_ID=$(jq -r '.id // empty' /tmp/rel.json 2>/dev/null || true)
if [ -z "$REL_ID" ]; then
echo "ERROR: Release-Lookup fehlgeschlagen (HTTP ${HTTP}) fuer Tag '${TAG}'."
if [ -z "${{ secrets.GITEATOKEN }}" ]; then
echo " -> Secret GITEATOKEN ist in DIESEM Repo NICHT gesetzt."
if [ -z "${TOKEN}" ]; then
echo " -> gitea.token ist leer (Actions-Token nicht verfuegbar)."
else
echo " -> GITEATOKEN ist gesetzt; vermutlich fehlt dem Token der Scope (repository) oder der Tag stimmt nicht."
echo " -> Token vorhanden; evtl. fehlt dem Workflow-Token Schreibrecht"
echo " (Repo Settings -> Actions -> General -> Workflow permissions = Read/Write),"
echo " oder der Tag '${TAG}' stimmt nicht."
fi
echo " Antwort (gekuerzt): $(head -c 300 /tmp/rel.json)"
exit 1