如何在GitHub Actions工作流文件中使用自定义路径?

huangapple go评论35阅读模式
英文:

How to use a custom path for GitHub Actions workflow file?

问题

可以使用 GitHub Actions 的路径除了 /.github/workflows/action.yml 之外吗?
例如,我可以使用 /foo/bar/.github/workflows/action.yml 吗?
(根路径中没有 /.github/...
如果可以,我该如何实现这个目标?

我尝试创建 /foo/bar/.github/workflows/action.yml 但没有成功。

英文:

Is it possible to use GitHub Actions with a path other than /.github/workflows/action.yml?
For example, can I use /foo/bar/.github/workflows/action.yml?
(without /.github/... in root path)
If so, how can I achieve this?

I tried creating /foo/bar/.github/workflows/action.yml but it didn't work.

答案1

得分: 0

这是来自官方文档的摘录:

> 您必须将工作流文件存储在存储库的 .github/workflows 目录中。

这意味着您可以在.github/workflows下有子文件夹,其中包含更多的工作流/操作,但路径的根必须是.github/workflows

英文:

This is the excerpt from the official documentation:

> You must store workflow files in the .github/workflows directory of your repository.

This means that you can have subfolders under .github/workflows, which contain more workflows/actions, but the root of the path must be .github/workflows.

huangapple
  • 本文由 发表于 2023年7月11日 12:03:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/76658638.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定