diff --git a/.gitea/workflows/docker-publish.yml b/.gitea/workflows/docker-publish.yml index 3d0b4cd..d064ec7 100644 --- a/.gitea/workflows/docker-publish.yml +++ b/.gitea/workflows/docker-publish.yml @@ -238,8 +238,24 @@ jobs: echo "atelier_ref=${ATELIER_REF}" >> "$GITHUB_OUTPUT" echo "atelier_tag=${ATELIER_TAG}" >> "$GITHUB_OUTPUT" - # pi-toolkit / pi-extensions (Gitea) → commit SHAs. Gitea API - # requires auth even for public-repo commit listing. + # pi-toolkit / pi-extensions (Gitea) → commit SHAs. All three Gitea + # repos read in this step are PUBLIC: an unauthenticated GET of these + # commit endpoints returns 200 with the IDENTICAL sha (verified + # 2026-08-15 for pi-toolkit, pi-extensions and mempalace-toolkit). + # The comment that used to sit here claimed the Gitea API "requires + # auth even for public-repo commit listing" — it does not. Only + # /api/v1/repos/*/actions/* refuses anonymous reads (401), which is + # what that claim was almost certainly generalised from. + # + # The header is still passed on purpose: it keeps working if a repo is + # ever flipped private, and an ABSENT secret degrades cleanly, because + # Gitea ignores an empty `token ` value and serves the request + # anonymously (200). The real hazard is the opposite one — a REVOKED or + # malformed token returns 401 where anonymous would have returned 200, + # so a stale GITEA_BUILD_TOKEN turns a healthy public read into a + # require_sha failure that reads like an API or network fault. If this + # step ever fails on a repo you can browse anonymously, suspect the + # token before you suspect Gitea. TOOLKIT_REF=$(curl -sf -H "$AUTH_HEADER" \ "https://gitea.jordbo.se/api/v1/repos/joakimp/pi-toolkit/commits?limit=1&sha=main" \ | jq -r '.[0].sha // empty' 2>/dev/null || true)