ci: registry login via REGISTRY_TOKEN secret — Actions token is rejected
server-release / image (push) Successful in 25s
server-release / release (push) Successful in 26s

docker was present on the echolot runner; the login failed because
Gitea's container registry does not accept the ephemeral Actions token.
Requires a PAT with package read/write scope as the REGISTRY_TOKEN repo
secret (REGISTRY_USER optional, defaults to the actor); fails with a
self-explanatory error when missing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
mrambossek
2026-07-30 16:33:01 +02:00
co-authored by Claude Opus 5
parent 234622549c
commit ebcb012450
+12 -3
View File
@@ -9,8 +9,13 @@
# Tags are namespaced (server-v1.2.3) so app releases (v*) and server # Tags are namespaced (server-v1.2.3) so app releases (v*) and server
# releases don't trigger each other's pipelines. # releases don't trigger each other's pipelines.
# #
# Required secrets: none beyond the built-in GITHUB_TOKEN — it can push to # Required secrets:
# the registry of its own repo and create releases. # REGISTRY_TOKEN personal access token with read+write package scope —
# the built-in Actions token is NOT accepted by the
# container registry (docker login → unauthorized).
# Create: user Settings → Applications → Generate token.
# REGISTRY_USER optional; defaults to the pushing actor's username.
# The release job needs only the built-in GITHUB_TOKEN.
name: server-release name: server-release
on: on:
@@ -79,9 +84,13 @@ jobs:
echo "image=$HOST/${GITHUB_REPOSITORY,,}-server" >> "$GITHUB_OUTPUT" echo "image=$HOST/${GITHUB_REPOSITORY,,}-server" >> "$GITHUB_OUTPUT"
- name: Build + push image (needs a Docker-capable runner) - name: Build + push image (needs a Docker-capable runner)
env:
REGISTRY_USER: ${{ secrets.REGISTRY_USER || github.actor }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: | run: |
command -v docker >/dev/null || { echo "::error::no docker on this runner — image skipped; binaries/release are unaffected"; exit 1; } command -v docker >/dev/null || { echo "::error::no docker on this runner — image skipped; binaries/release are unaffected"; exit 1; }
echo "${{ secrets.GITHUB_TOKEN }}" | docker login "${{ steps.meta.outputs.host }}" -u "$GITHUB_ACTOR" --password-stdin [ -n "$REGISTRY_TOKEN" ] || { echo "::error::secret REGISTRY_TOKEN missing — the registry rejects the built-in Actions token. Create a PAT with package read/write scope and add it under Settings → Actions → Secrets."; exit 1; }
echo "$REGISTRY_TOKEN" | docker login "${{ steps.meta.outputs.host }}" -u "$REGISTRY_USER" --password-stdin
docker build server \ docker build server \
--build-arg VERSION=${{ steps.meta.outputs.version }} \ --build-arg VERSION=${{ steps.meta.outputs.version }} \
-t "${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }}" \ -t "${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }}" \