本站在允许 JavaScript 运行的环境下浏览效果更佳


Fixing github action push to ghcr '403 Forbidden' error

此文章有中文版本/This article is available in Chinese

Phenomenon

The GitHub Action workflow setup looks like this:

Screenshot of the GitHub Action workflow setup

When running it, the following error occurs:

Error screenshot showing a 403 Forbidden issue

Solution

Everything worked fine during the initial build. However, when I re-cloned the repository and attempted to build it again while preparing a tutorial, I kept encountering a 403 error. After a lengthy search, I finally found the solution.

Original discussion link: Random 403 errors when pushing to GHCR · Issue #463 · docker/build-push-action (github.com)

Adjust Settings on GitHub

Access the following URL:
https://github.com/orgs/[XXX]/packages/container/[YYY]/settings

Replace [XXX] with your GitHub username and [YYY] with the project name.
For instance, after forking the repository, my repo is HowieHz/umami, so I accessed:
https://github.com/orgs/HowieHz/packages/container/umami/settings

Screenshot showing the GitHub package settings page

Fix the Permissions

Following onedr0p's instructions:

  1. Click on Add Repository to include your repository.
  2. Set the rule to Write or Admin.

After these changes, the issue should be resolved.

To make searching easier, this article and the one linked above were extracted from the following article:
Addressing the Umami Active API Latency Issue