Skip to main content

此版本的 GitHub Enterprise Server 将于以下日期停止服务 2026-03-17. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

Managing custom properties for organizations

With custom properties, you can add metadata to organizations in your enterprise and use that metadata to target repositories with rulesets.

谁可以使用此功能?

Enterprise owners and users with the "Manage the Enterprise's custom properties definitions" permission can add and set a custom property schema at the enterprise level.

注意

Organization custom properties are in public preview and subject to change. For GitHub Enterprise Server, this feature will only be available from version 3.22.

About custom properties

Custom properties are structured metadata fields that you can add to repositories and organizations in GitHub to enable better organization, governance, and automation across your environment. See Custom properties.

This article relates to organization custom properties.

Allowed characters

自定义属性名称和值只能包含特定的字符:

  • 名称:a-zA-Z0-9_-$#
  • 值:所有可打印的 ASCII 字符," 除外。

Adding custom properties

You can add custom properties to your enterprise and set values for those properties for organizations in your enterprise.

  1. 在 GitHub Enterprise Server 的右上角,单击你的个人资料头像,然后单击“Enterprise settings”****。

  2. 在企业名称下,单击 “Organizations”选项卡****。

    企业屏幕截图。 “Organizations”选项卡以橙色边框突出显示。

  3. In the left sidebar, click Custom properties.

  4. To add a new custom property, click New property in the upper right corner.

  5. In the "Name" field, type the name you'd like to use for your custom property. The name can't contain spaces, and cannot exceed 75 characters in length.

  6. Optionally, in the "Description" field, add a description for the custom property.

  7. Under "Type", select the type of property you'd like to add.

  8. Optionally, select Allow organization actors to set this property to allow organization users and apps with the organization-level "custom properties" fine-grained permission to set and update the property value for their organization.

  9. Optionally, select Require this property for all organizations and add a default value. Enabling this option indicates that you require that all organizations in your enterprise have a value for this property. Organizations that don't have an explicit value for this property will inherit the default value.

  10. Click Save property.

Setting values for organizations in your enterprise

You, and any users with the "Edit custom properties values at the organization level" permission, can set values for custom properties for organizations in your enterprise.

  1. 在 GitHub Enterprise Server 的右上角,单击你的个人资料头像,然后单击“Enterprise settings”****。

  2. 在企业名称下,单击 “Organizations”选项卡****。

    企业屏幕截图。 “Organizations”选项卡以橙色边框突出显示。

  3. In the left sidebar, click Custom properties.

  4. Click the "Set values" tab.

  5. Select one or more organizations from the list and click Edit properties.

  6. In the modal dialog that appears, select a value for each property you'd like to set for the selected organizations.

  7. Click Save changes.