Bug: Publish OCI Artifact 连续失败——镜像名含大写(github.repository_owner 未小写化)

Open Beginner friendly
#331 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, github-actions
Domain
ci-cd

Research direction

Start in the Publish OCI Artifact workflow (oci-artifact.yml), where the IMAGE env line builds the ghcr.io reference from github.repository_owner, which contains uppercase letters. Lowercase the owner, either by hardcoding the name or with bash lowercase expansion as the issue suggests. Done when the workflow passes and oras discover finds the artifact. The jq error handling in pull-request.yml is a separate, optional follow-up.

Written by the indexing model from the issue text.

Description

Bug: Publish OCI Artifact 自 10-22 起连续失败

现象:Publish OCI Artifact 最近 4 次运行全部失败(10-22 ×2、10-29、11-12、11-14 ×2)。

根因:

Error: "ghcr.io/LinuxSuRen/hd-home-config:latest": invalid reference:
invalid repository "LinuxSuRen/hd-home-config"

workflow 中 IMAGE: ghcr.io/${{ github.repository_owner }}/hd-home-config——github.repository_owner 的值是 LinuxSuRen(含大写字母),而 GHCR/ORAS 要求镜像仓库名必须全小写,因此 oras push 在登录后第一步即被拒绝。

修复建议(任选其一):

  1. 直接写死小写:IMAGE: ghcr.io/linuxsuren/hd-home-config(最简单);
  2. 保持动态 + 小写化(bash 参数展开):
      - name: Resolve image
        run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/hd-home-config" >> "$GITHUB_ENV"

连带:pull-request.yml 的 Build 对错误响应没有防护(curl | jq '.[] | .filename' 在 API 返回错误对象时直接崩,见 dependabot PR #325 的失败日志),建议一并加 set -o pipefail 与响应校验。

修复验证方式:合并后观察 Publish OCI Artifact 变绿、oras discover 能看到 artifact。

Dominant language
Dockerfile
Stars
7
Forks
8
Avg merge
13h 11m
Merged PRs (30d)
9

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LinuxSuRen/hd-home

All issues in LinuxSuRen/hd-home

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.