GitLab CI执行自定义步骤时出现“no such file or directory”错误求助
问题解决:GitLab CI Step 找不到 func.yml 文件
核心原因
GitLab CI 的自定义步骤(Steps)要求步骤配置文件必须命名为 func.yml,而你当前使用的是 step.yml,导致 runner 在缓存目录中查找 func.yml 时失败。
解决方案
- 进入
gitlab.com/namespace/zero-to-steps仓库的本地副本 - 将
steps/step.yml重命名为steps/func.yml - 提交并推送修改到 main 分支:
git mv steps/step.yml steps/func.yml git commit -m "rename step.yml to func.yml for GitLab CI Step requirement" git push origin main
- 重新触发测试仓库的 CI 流水线
验证要点
确认修改后,配置文件路径为 steps/func.yml,与错误日志中 runner 尝试访问的路径 /tmp/step-runner-cache/.../steps/func.yml 完全匹配。
内容的提问来源于stack exchange,提问作者Dorian Turba
相关产品推荐
相关产品推荐

