diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 50b63df..b51b488 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -144,12 +144,19 @@ jobs: run: | set -euo pipefail # GITHUB_TOKEN login "succeeds" but blob uploads 401 (Forgejo packages - # reject the Actions token). Use a user PAT with write:package. - if [ -z "${{ secrets.FORGEJO_TOKEN }}" ]; then - echo "Missing repo secret FORGEJO_TOKEN (user PAT, not GITHUB_TOKEN)" + # reject the Actions token). Use a user PAT. + # The PAT must carry the `write:package` scope: Forgejo mints a push + # token even without it and then rejects every blob upload with + # `unauthorized: reqPackageAccess` (routers/api/packages/api.go + # reqPackageAccess -> AccessTokenScopeWritePackage). + # Name is REGISTRY_TOKEN, not FORGEJO_TOKEN: Forgejo reserves the + # FORGEJO_/GITHUB_ prefixes and refuses to create or update them via + # the API. + if [ -z "${{ secrets.REGISTRY_TOKEN }}" ]; then + echo "Missing repo secret REGISTRY_TOKEN (user PAT with write:package, not GITHUB_TOKEN)" exit 1 fi - echo "${{ secrets.FORGEJO_TOKEN }}" | docker login "${{ steps.img.outputs.reg }}" \ + echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "${{ steps.img.outputs.reg }}" \ -u sirius --password-stdin - name: Build application image (api / ingester / cameras)