Organizationのインタラクション
Organization interactions APIを使用すると、OrganizationのオーナーはOrganizationのパブリックリポジトリでコメント、Issueのオープン、Pull Requestの作成ができるユーザのタイプを一時的に制限することができます。
Organization interactions APIについて
Organization interactions APIを使用すると、OrganizationのオーナーはOrganizationのパブリックリポジトリでコメント、Issueのオープン、Pull Requestの作成ができるユーザのタイプを一時的に制限することができます。 制限が有効化されると、指定した種類のGitHub Enterprise Cloudユーザのみがインタラクションに参加できるようになります。 制限は、定義された期間の後に自動的に期限切れになります。 GitHub Enterprise Cloud ユーザのタイプについては以下を参照してください。
- OrganizationのExisting users(既存のユーザ): インタラクションを
existing_users
に制限すると、24時間以下しか経過していないアカウントの新規ユーザで、以前にコントリビューションしておらず、コラボレーターでもないユーザは、一時的に制限されます。 - OrganizationのContributors only(コントリビューターのみ):インタラクションを
contributors_only
に制限すると、以前にコントリビューションしておらず、コラボレーターでもないユーザは一時的に制限されます。 - OrganizationのCollaborators only(コラボレーターのみ): インタラクションを
collaborators_only
に制限すると、コラボレーターではないユーザは、一時的に制限されます。
Organizationレベルでインタラクション制限を設定すると、Organizationが所有する個々のリポジトリに設定されているインタラクション制限は上書きされます。 Organizationが所有する個々のリポジトリに対して異なるインタラクション制限を設定するには、かわりにリポジトリインタラクションエンドポイントを使用してください。
Get interaction restrictions for an organization
Shows which type of GitHub user can interact with this organization and when the restriction expires. If there is no restrictions, you will see an empty response.
パラメータ
Headers |
---|
名前, 種類, 説明 |
accept stringSetting to |
Path parameters |
名前, 種類, 説明 |
org string必須The organization name. The name is not case sensitive. |
HTTP response status codes
Status code | 説明 |
---|---|
200 | OK |
コードサンプル
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/orgs/ORG/interaction-limits
Response
Status: 200
{
"limit": "collaborators_only",
"origin": "organization",
"expires_at": "2018-08-17T04:18:39Z"
}
Set interaction restrictions for an organization
Temporarily restricts interactions to a certain type of GitHub user in any public repository in the given organization. You must be an organization owner to set these restrictions. Setting the interaction limit at the organization level will overwrite any interaction limits that are set for individual repositories owned by the organization.
パラメータ
Headers |
---|
名前, 種類, 説明 |
accept stringSetting to |
Path parameters |
名前, 種類, 説明 |
org string必須The organization name. The name is not case sensitive. |
Body parameters |
名前, 種類, 説明 |
limit string必須The type of GitHub user that can comment, open issues, or create pull requests while the interaction limit is in effect. Can be one of: |
expiry stringThe duration of the interaction restriction. Default: Can be one of: |
HTTP response status codes
Status code | 説明 |
---|---|
200 | OK |
422 | Validation failed |
コードサンプル
curl \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/orgs/ORG/interaction-limits
Response
Status: 200
{
"limit": "collaborators_only",
"origin": "organization",
"expires_at": "2018-08-17T04:18:39Z"
}
Remove interaction restrictions for an organization
Removes all interaction restrictions from public repositories in the given organization. You must be an organization owner to remove restrictions.
パラメータ
Headers |
---|
名前, 種類, 説明 |
accept stringSetting to |
Path parameters |
名前, 種類, 説明 |
org string必須The organization name. The name is not case sensitive. |
HTTP response status codes
Status code | 説明 |
---|---|
204 | No Content |
コードサンプル
curl \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
https://api.github.com/orgs/ORG/interaction-limits
Response
Status: 204