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

同一仓库调用GitHub Composite Action报错,如何实现仓库内验证?

This error happens because your workflow file (validate.yml) lives in .github/workflows, and the path ./action.yaml you're using points to within that workflows directory—but your actual action.yaml is in the root of your repository. GitHub can't find the file because it's looking in the wrong place.

Here's how to fix it:

Fix 1: Use the correct relative path

Update the uses line to point to the root directory's action.yaml using a relative path from the workflows folder. Since you need to go up two levels (from .github/workflows to .github, then to the repo root), the path will be ../../action.yaml:

name: Invoke my action
uses: ../../action.yaml
with:
  <My inputs>

Optional: Verify the file structure first (for debugging)

If you want to double-check the directory structure before fixing the path, add a quick step to your workflow to list all files:

steps:
  - name: Inspect repository structure
    run: ls -R
    shell: bash

This will show you exactly where your action.yaml lives relative to the workflow file, so you can confirm the path you need.

When you call this action from other repositories, using owner/your-repo@main works because GitHub automatically looks for the action file in the root of the target repository. But when running it locally in your own repo, you have to account for the workflow file's location in .github/workflows.

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.04 17:15:51