From 923d68f31724cbd1d93577b6d3538ec78f42eb17 Mon Sep 17 00:00:00 2001 From: Aneurin Barker Snook Date: Sat, 5 Sep 2026 13:48:18 +0100 Subject: [PATCH] restore previous fixes with renamed token property --- .gitea/workflows/build.yml | 16 +++++++++------- .gitea/workflows/release.yml | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 37d3cfd..c0d38e1 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -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.BUILD_API_TOKEN -- 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 @@ -41,7 +41,9 @@ jobs: - uses: actions/checkout@v4 - name: Log in to the container registry - run: echo "${{ secrets.GITEA_TOKEN }}" | docker login code.aneur.in -u "${{ gitea.actor }}" --password-stdin + env: + BUILD_API_TOKEN: ${{ secrets.BUILD_API_TOKEN }} + run: echo "$BUILD_API_TOKEN" | docker login code.aneur.in -u "${{ gitea.actor }}" --password-stdin - name: Promote the current "latest" to "previous" run: | diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 68ebbca..588a82a 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -10,17 +10,17 @@ name: Release # Assumes tags are cut from commits already on main (and so already covered # by ci.yml's checks) -- this workflow doesn't run the test suite itself. # -# Requires secrets.GITEA_TOKEN (auto-injected; needs the "packages" -# permission scope to push images). +# Requires secrets.BUILD_API_TOKEN -- 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: tags: ['*'] -permissions: - contents: read - packages: write - jobs: build-and-push: runs-on: ubuntu-latest @@ -39,7 +39,9 @@ jobs: - uses: actions/checkout@v4 - name: Log in to the container registry - run: echo "${{ secrets.GITEA_TOKEN }}" | docker login code.aneur.in -u "${{ gitea.actor }}" --password-stdin + env: + BUILD_API_TOKEN: ${{ secrets.BUILD_API_TOKEN }} + run: echo "$BUILD_API_TOKEN" | docker login code.aneur.in -u "${{ gitea.actor }}" --password-stdin - name: Build and push the image run: |