跳到主内容
精选75GitHub Changelog云与平台

GitHub Rulesets 推送规则新增路径例外,支持按文件路径豁免(公开预览)

Push rules in rulesets now support path exceptions

原文
推荐理由

对于依赖 GitHub 仓库管理的开发者,这个功能让你在不放松全局规则的前提下,为特定路径开绿灯,值得立即体验。建议在预览期试用路径例外,优化你的推送规则配置。

You can now configure push rules more granularly by exempting specific file paths, so a rule applies everywhere in scope except the paths you choose. Path exceptions are in public preview.

您现在可以通过豁免特定文件路径来更精细地配置推送规则,使规则适用于范围内的所有位置,但您选择的路径除外。路径例外目前处于公开预览阶段。

Push rules give you strong control over what enters a repository. Sometimes a rule needs a narrow exception, and until now your options were to relax it for everyone or enforce it outside of GitHub. You can now keep the rule in place and exempt only the paths that need it.

推送规则让您对进入仓库的内容拥有强大的控制力。有时规则需要狭窄的例外,而在此之前,您的选择要么是为所有人放宽规则,要么是在GitHub之外强制执行。现在,您可以保留规则,仅豁免需要豁免的路径。

Where to find it

在哪里找到它

When you configure either supported rule, expand Allowed exceptions and add the path patterns the rule should skip. GitHub validates your patterns when you save the ruleset, so you can fix mistakes right away.

当您配置任一受支持的规则时,展开“允许的例外”并添加规则应跳过的路径模式。当您保存规则集时,GitHub会验证您的模式,因此您可以立即修复错误。

Two push rules support exceptions today:

目前,两条推送规则支持例外:

  • Restrict file paths: Block a file type across the repository while allowing it at a specific path, such as blocking JAR files everywhere except **/gradle/wrapper/*.jar.
  • Restrict file size: Enforce a size limit while exempting paths that already exceed it, so you can adopt the limit without changing those files first.
  • 限制文件路径:阻止仓库中的某种文件类型,同时允许其在特定路径下存在,例如阻止除**/gradle/wrapper/*.jar之外的所有JAR文件。
  • 限制文件大小:强制执行大小限制,同时豁免已超出限制的路径,这样您可以在不先更改这些文件的情况下采用该限制。

For pattern syntax and the full list of push rules, see available rules for rulesets.

有关模式语法和推送规则的完整列表,请参阅规则集的可用规则。

Join the community discussion to share feedback.

加入社区讨论以分享反馈。

The post Push rules in rulesets now support path exceptions appeared first on The GitHub Blog.

文章《规则集中的推送规则现在支持路径例外》最初出现在GitHub博客上。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

另一事件,读法相近