[FAQ] GHCR push returns denied in GitHub Actions even with packages: write
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 86/100
- issue の種類
- ドキュメント
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- docker, github-actions
- 領域
- devops, documentation
調査の方向性
リポジトリのFAQ項目を読み、トラブルシューティングの手順と再試行の例を、リンク先の .github/workflows/cd.yml と比較してください。記述が、観測された最初のpushの失敗と、通常の権限や命名に関する原因を区別していることを確認してください。回答が明確で、例が動作するworkflowを示していれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Course
ai-dev-tools-zoomcamp
Question
Final project CI/CD: my GitHub Actions workflow gets denied when pushing a new image to GHCR, even though it has packages: write and docker login succeeds. How do I fix it?
Answer
Re-run the job, and add a retry to the push. In my project the first push of each brand-new package failed, and the same push succeeded on the re-run, with no change to the workflow.
What the log looked like. The layers upload, then the push fails:
ae51df8ce05a: Pushed
error from registry: denied
denied
I had two images, and each one failed once. The first run failed on the API image. The re-run published it and then failed on the frontend image. The third run published both. Later pushes to the same packages had no problem.
Before assuming that's your issue, check the usual causes of denied:
- The workflow or job has
permissions: packages: write. The default token may be read-only. - The image name uses your own lowercase owner:
ghcr.io/<owner>/<name>. docker/login-actionusespassword: ${{ secrets.GITHUB_TOKEN }}, and the log showsLogin Succeeded!.
If all three are fine and the package doesn't exist yet, retry so a fresh setup doesn't need a manual re-run:
for attempt in 1 2 3; do
docker push --all-tags "$repository" && break
[ "$attempt" = 3 ] && exit 1
sleep 15
done
I don't know the exact cause on GitHub's side. This is what I observed, on a public repository with a user-owned package.
Working example: https://github.com/devotuoma/chamaledger/blob/main/.github/workflows/cd.yml
Checklist
- I have searched existing FAQs and this question is not already answered
- The answer provides accurate, helpful information
- I have included any relevant code examples or links
- 主要言語
- Python
- スター
- 8
- フォーク
- 20
- 平均マージ
- 3日 14時間
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
DataTalksClub/faq のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 70/100
DataTalksClub/faq#545 ·
メンテナーはふだん 2 日以内に返信
-
Fixing ValueError: feature_names must not contain [, ], or < in XGBoost対応中かも @github-actions が 7 日前に担当しました。 オープンfaq-proposal
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
DataTalksClub/faq#536 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
How to fix uv warning: VIRTUAL_ENV does not match the project environment path対応中かも @github-actions が 7 日前に担当しました。 オープンfaq-proposal
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
DataTalksClub/faq#534 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Fixing ValueError: This solver needs samples of at least 2 classes in Logistic Regression対応中かも @github-actions が 7 日前に担当しました。 オープンfaq-proposal
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
DataTalksClub/faq#532 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
DataTalksClub/faq#531 ·
メンテナーはふだん 2 日以内に返信
DataTalksClub/faq の issue をすべて見る
似ている issue
-
Remove the `pull_request_target` workflow before GitHub blocks it対応中かも @jat255 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
IBM/mcp-context-forge#7483 ·
メンテナーはふだん 2 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
[Bug Report]: OpenAI 辅助 API 连通性测试因输出上限仅 1 token 误报“未知错误”対応中かも @fjfanjian が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Project-N-E-K-O/N.E.K.O#3640 ·
メンテナーはふだん 1 日以内に返信
-
author-page correction
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
acl-org/acl-anthology#10808 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信