From 28438dcde66d4340923c2a9349d18f45dbb09bce Mon Sep 17 00:00:00 2001 From: Brad Rodgers Date: Thu, 16 Jul 2026 16:02:00 -0400 Subject: [PATCH] ci: use CI_TOKEN PAT for registry push and tag-bump --- .gitea/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 64eaad9..4538abd 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -66,9 +66,12 @@ jobs: curl -sSL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv5.4.3/kustomize_v5.4.3_linux_amd64.tar.gz" \ | tar xz -C /usr/local/bin + # CI_TOKEN: a Gitea Personal Access Token (scopes: write:package, write:repository) owned by + # the repo owner, stored as a repo Actions secret. The auto GITEA_TOKEN lacks reliable package + # scope on Gitea, hence a dedicated PAT for both the registry push and the tag-bump commit. - name: Build & push image to Gitea Packages run: | - echo "${{ secrets.GITEA_TOKEN }}" | docker login 10.66.15.22:3000 -u "${{ github.actor }}" --password-stdin + echo "${{ secrets.CI_TOKEN }}" | docker login 10.66.15.22:3000 -u "${{ github.repository_owner }}" --password-stdin docker build -t "$IMAGE:${{ steps.tag.outputs.sha }}" -t "$IMAGE:latest" . docker push "$IMAGE:${{ steps.tag.outputs.sha }}" docker push "$IMAGE:latest" @@ -81,5 +84,5 @@ jobs: git add k8s/kustomization.yaml git diff --cached --quiet && { echo "no image change"; exit 0; } git commit -m "ci: deploy ${{ steps.tag.outputs.sha }} [skip ci]" - git remote set-url origin "http://gitea-actions:${{ secrets.GITEA_TOKEN }}@10.66.15.22:3000/bmr_bluecap/bcs-website.git" + git remote set-url origin "http://${{ github.repository_owner }}:${{ secrets.CI_TOKEN }}@10.66.15.22:3000/bmr_bluecap/bcs-website.git" git push origin HEAD:main