Fix container registry login: GITEA_TOKEN never grants package access
CI / php-tests (pull_request) Successful in 22s
CI / frontend-build (pull_request) Successful in 35s
Build / build-and-push (push) Failing after 13m53s

The auto-injected secrets.GITEA_TOKEN doesn't work for pushing to
Gitea's container registry regardless of the workflow's own
permissions: block -- a known Gitea limitation, not a config mistake
(go-gitea/gitea#23642). Switch to a manually-configured
CONTAINER_REGISTRY_PASSWORD secret (a personal access token with
write:package scope) instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit was merged in pull request #5.
This commit is contained in:
2026-09-05 12:58:03 +01:00
co-authored by Claude Sonnet 5
parent 950d116e53
commit 8bb9f05559
2 changed files with 16 additions and 16 deletions
+8 -8
View File
@@ -10,18 +10,18 @@ name: Build
# This project's CI/CD scope is intentionally just test/build/push --
# deployment is being split into a separate project.
#
# Requires secrets.GITEA_TOKEN (auto-injected by Gitea Actions; needs the
# "packages" permission scope to push images).
# Requires secrets.CONTAINER_REGISTRY_PASSWORD -- a personal access token
# (write:package scope) from the pushing account, stored manually as a repo
# secret. The auto-injected secrets.GITEA_TOKEN does NOT work for this: it
# never grants package-registry access regardless of the workflow's own
# `permissions:` block -- a known Gitea limitation, not a config mistake
# (https://github.com/go-gitea/gitea/issues/23642).
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
@@ -42,8 +42,8 @@ jobs:
- name: Log in to the container registry
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: echo "$GITEA_TOKEN" | docker login code.aneur.in -u "${{ gitea.actor }}" --password-stdin
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
run: echo "$CONTAINER_REGISTRY_PASSWORD" | docker login code.aneur.in -u "${{ gitea.actor }}" --password-stdin
- name: Promote the current "latest" to "previous"
run: |