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 '认证文件已生成,开始构建...' &&