From bf0a39dcb42d323b32cb83bfe45e1e7025181c29 Mon Sep 17 00:00:00 2001 From: gitea_admin Date: Thu, 18 Dec 2025 15:34:36 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.github/workflows/buidl=5F?= =?UTF-8?q?and=5Fpush=5Fghcr.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/buidl_and_push_ghcr.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/buidl_and_push_ghcr.yml b/.github/workflows/buidl_and_push_ghcr.yml index aad1e44..5938b06 100644 --- a/.github/workflows/buidl_and_push_ghcr.yml +++ b/.github/workflows/buidl_and_push_ghcr.yml @@ -1,14 +1,10 @@ -name: Build with Kaniko (Hardcoded No Vars) +name: Build with Kaniko (PAT Auth) on: push: branches: [ main ] workflow_dispatch: -permissions: - packages: write - contents: read - jobs: build: runs-on: ubuntu-latest @@ -20,13 +16,14 @@ jobs: uses: docker://gcr.io/kaniko-project/executor:v1.23.2-debug with: entrypoint: /busybox/sh - # 注意:下面所有出现域名的地方都直接写死了,确保不会出错 args: >- -c " - echo '正在生成认证信息...' && + echo '正在生成认证信息 (使用 PAT)...' && - echo '{\"auths\":{\"gitea.173114.xyz\":{\"username\":\"${{ gitea.actor }}\",\"password\":\"${{ secrets.PACKAGES_TOKEN }}\"}}}' > /kaniko/.docker/config.json && + # === 重点修改在这里 === + # 将 secrets.GITHUB_TOKEN 换成了 secrets.PACKAGES_TOKEN + echo '{\"auths\":{\"gitea-http.gitea.svc.cluster.local:3000\":{\"username\":\"${{ gitea.actor }}\",\"password\":\"${{ secrets.PACKAGES_TOKEN }}\"}}}' > /kaniko/.docker/config.json && echo '认证文件已生成,开始构建...' &&