You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

GitHub Action推送Docker镜像时出现installation not allowed to Write organization package错误

GitHub Action推送镜像权限错误解决

遇到的错误:

denied: installation not allowed to Write organization package
Error: Process completed with exit code 1.

这是权限配置不足导致的,按以下两种方式调整:

1. 在工作流文件中修改GITHUB_TOKEN权限

在你的GitHub Action工作流YAML文件(比如.github/workflows/build.yml)里,添加或更新permissions配置,给GITHUB_TOKEN分配包写入权限:

# 可放在工作流顶层,对所有job生效
permissions:
  packages: write

# 也可针对推送镜像的特定job单独设置
jobs:
  push-image:
    permissions:
      packages: write
    steps:
      # 你的镜像推送步骤...

2. 配置仓库级别的Workflow权限

  1. 打开仓库的「Settings」页面
  2. 左侧导航栏选「Actions」→「General」
  3. 找到「Workflow permissions」区域,选择「Read and write permissions」后保存
  4. 若需精细控制,可选「Custom permissions」,确保勾选「Packages」的写入权限

内容的提问来源于stack exchange,提问作者piper

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 06:04:56