有没有一种方法可以将.github/.gitlab文件夹放在项目内的自定义路径中?

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

Is there a way to place the .github/.gitlab folders in a custom path inside my project?

问题

I will provide the translation without code:

我正在进行一个项目,该项目有多个设置文件和文件夹,它们放在Git项目的根目录。我试图实现的目标是将它们组织到一个文件夹中,该文件夹将放在项目的根目录,并包含一个位于项目根目录的单个文件,比如 .gitconfig,该文件将指向这些文件夹的路径,以便例如 Github 或 Gitlab 能够找到相应的文件夹。

根据我在线进行的研究,我找不到与我的问题相关的任何信息。但是,我相信应该存在一种方法来实现这一目标,因为在具有多个环境、设置文件和多人参与的大型项目中,Git 项目的根文件夹会变得混乱。

英文:

I'm working on a project that has multiple setup files and folders that are placed on the root of the Git project. What I'm trying to achieve is to organize them inside a folder that will be placed on the root of the project and then contain a single file on the root of the project like .gitconfig that will point to the paths of those folders, so Github or Gitlab for example will be able to find the appropriate folders.

From a research I did online, I couldn't find anything related to my issue. However, I believe that there should exist a way to achieve this because on large projects with multiple environments, setup files and people working on it the root folder of the Git project will be a chaos.

答案1

得分: 1

以下是翻译好的部分:

这似乎不受支持。

例如,GitHub Actions 包括工作流程,正如文档提到的,它们必须位于存储库根文件夹中的.github/workflows目录中,GitHub Actions 将不会读取其他位置以获取其操作的路径。

对于.gitlab-ci.yml,也是相同的理念,它必须位于存储库的根目录,尽管它可以包含其他 yml 管道定义

英文:

That does not seem to be supported.

For instance, GitHub Actions include workflows, which, as the documentation mentions, must be in a .github/workflows directory in the root folder of the repository, and a GitHub Action will not read anything else to get the path of its actions.

Same idea for a .gitlab-ci.yml, which must be in the root of your repository, although it can include other yml pipeline definition.

huangapple
  • 本文由 发表于 2023年4月11日 16:39:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/75983938.html
匿名

发表评论

匿名网友

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

确定