如何在我的组织中的多个项目中应用GITHUB行动?

发布于 2025-02-01 12:14:51 字数 210 浏览 0 评论 0 原文

在我的公司中,我们有数百个存储库,至少有20个我们想通过执行github行动来应用绵羊。 复制相同的github操作工作流程中的每个 .github/workflows 文件夹似乎不好我们将其更改,然后所有其他文件更改。

如何将一个github操作应用于多个github存储库,而不将此文件复制到每个github项目中的每个文件夹中? 这是一个GitHub企业帐户。

In my company we have a few hundred repositories, for at least 20 of those we want to apply linting by doing github actions.
It seems not good to copy the same github action workflow into each .github/workflows folder for a few reasons one is that the action is duplicated, no single source of truth, there should be one file somewhere if we change it then all the other files change.

How to apply one github action to multiple github repositories without copying this file into every single .github/workflows folder in every one of these github projects?
This is a github enterprise account.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜深人未静 2025-02-08 12:14:52

Q1 2024:旧的“组织范围范围的工作流”(请参阅​​第二部分)已替换为 sureteets 。 (我在在这里>那里

规则集是适用于存储库或组织中多个存储库的规则列表。
您可以创建规则集,以控制人们如何与存储库中选定的分支和标签进行交互。
您可以控制诸如谁可以推动某个分支,以及必须如何格式化或可以删除​​或重命名标签的事情。

例如,您可以为存储库的功能分支设置一个规则集,该分支需要签名的提交,并阻止除存储库管理员以外的所有用户的力量。

例如,请参见“ 需要工作流程在合并之前通过

规则集工作流程可以在组织级别配置,以要求在合并拉请请求之前通过工作流程。
有关“ 为您的组织中的存储库创建规则集


原始答案:检查此新功能(2023年1月)是否可以提供帮助:

GitHub动作 - 支持整个组织所需的工作流程公共Beta (2023年1月)

今天,我们正在宣布GitHub Action中所需工作流的公共Beta

所需的工作流程允许DevOps团队在组织内的许多源代码存储库中定义和执行标准CI/CD实践,而无需单独配置每个存储库。
组织管理员可以配置所需的工作流程以在组织内的所有或选定的存储库上运行。

“

所需的工作流程将作为所需的状态检查触发,以确定默认分支上打开的所有拉动请求,这会阻止合并拉的请求的能力,直到所需的工作流成功为止。

存储库级别的个人开发团队将能够查看已应用于其存储库所需的工作流程。

https://i0.wp.com/user-images.githubusercortent.com/25578249/211552010-D7AA7C25-F204-4C20-A04B-9C53F73F74EC52E.PNG? repo

除了减少CI/CD配置代码的重复外,所需的工作流程还可以帮助公司患有以下用例:

  • 安全性:调用外部漏洞评分或动态分析工具。

  • 合规性:确保所有代码都符合企业的质量标准。

  • 部署:确保以标准方式连续部署代码。

了解更多有关所需工作流程的信息

Q1 2024: the old "organization-wide required workflow" (see below second section) have been replaced with rulesets. (I mentioned those before here or there)

A ruleset is a named list of rules that applies to a repository, or to multiple repositories in an organization.
You can create rulesets to control how people can interact with selected branches and tags in a repository.
You can control things like who can push commits to a certain branch and how the commits must be formatted, or who can delete or rename a tag.

For example, you could set up a ruleset for your repository's feature branch that requires signed commits and blocks force pushes for all users except repository administrators.

See for instance "Require workflows to pass before merging"

Ruleset workflows can be configured at the organization level to require workflows to pass before merging pull requests.
More on "Creating rulesets for repositories in your organization"


Original answer: Check if this new feature (Jan. 2023) can help:

GitHub Actions – Support for organization-wide required workflows public beta (Jan. 2023)

Today, we are announcing public beta of required workflows in GitHub Actions

Required workflows allow DevOps teams to define and enforce standard CI/CD practices across many source code repositories within an organization without needing to configure each repository individually.
Organization admins can configure required workflows to run on all or selected repositories within the organization.

https://i0.wp.com/user-images.githubusercontent.com/25578249/211551996-c32d315d-e9a5-47fd-b74b-7263773ce77a.png?ssl=1 -- Required workflows at the organization level

Required workflows will be triggered as required status checks for all the pull requests opened on the default branch, which blocks the ability to merge the pull request until the required workflow succeeds.

Individual development teams at the repository level will be able to see what required workflows have been applied to their repository.

https://i0.wp.com/user-images.githubusercontent.com/25578249/211552010-d7aa7c25-f204-4c20-a04b-9c53f74ec52e.png?ssl=1 -- Required workflows run at repo

In addition to reducing duplication of CI/CD configuration code, required workflows can also help companies with the following use cases:

  • Security: Invoke external vulnerability scoring or dynamic analysis tools.

  • Compliance: Ensure that all code meets an enterprise’s quality standards.

  • Deployment: Ensure that code is continuously deployed in a standard way.

Learn more about required workflows

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文