Los usuarios interactuan con los repositorios al comentar, abrir informes de problemas y crear solicitudes de extracción. La API de interacciones permite a las personas con acceso de propietario o de administrador restringir la interacción con los repositorios públicos temporalmente a un tipo específico de usuario.
Organización
La API de Interacciones Organizacionales permite a los propietarios el restringir temporalmente qué tipo de usuariopuede comentar, abrir propuestas, o crear solicitudes de cambios en los repositorios públicos de la organización. Cuando se habilitan las restricciones, solo el tipo de usuario de GitHub que hayas especificado podrá participar en las interacciones. Las restricciones expiran automáticamente después de una duración definida. Aquí puedes aprender más sobre los tipos de usuario de GitHub:
- Usuarios existentes: Cuando limitas las interacciones a
existing_users, se restringirá temporalmente a los usuarios nuevos con cuentas de menos de 24 horas que no hayan hecho contribuciones anteriormente y que no sean colaboradores en la organización. - Solo para contribuyentes: Cuando limitas las interacciones para
contributors_only, se restringirá temporalmente a los usuarios que no hayan hecho contribuciones anteriormente y que no sean colaboradores en la organización. - Solo para colaboradores: Cuando limitas las interacciones para
collaborators_only, se restringirá temporalmente a los usuarios que no sean colaboradores en la organización.
Configurar el límite de interacciones a nivel organizacional sobreescribirá cualquier límite de interacción que se haya configurado para los repositorios individuales que pertenezcan a la organización. Para configurar los límites de interacción para los repositorios individuales que pertenezcan a la organización, mejor utiliza la terminal de interaciones del Repositorio.
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.
get /orgs/{org}/interaction-limits
Parámetros
| Name | Type | In | Description |
|---|---|---|---|
accept |
string | header |
Setting to
|
org |
string | path |
Ejemplos de código
Shell
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/interaction-limitsJavaScript (@octokit/core.js)
await octokit.request('GET /orgs/{org}/interaction-limits', {
org: 'org'
})
Response
Status: 200 OK
{
"limit": "collaborators_only",
"origin": "organization",
"expires_at": "2018-08-17T04:18:39Z"
}
Notes
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.
put /orgs/{org}/interaction-limits
Parámetros
| Name | Type | In | Description |
|---|---|---|---|
accept |
string | header |
Setting to
|
org |
string | path | |
limit |
string | body |
Required. 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 |
string | body |
The duration of the interaction restriction. Can be one of: |
Ejemplos de código
Shell
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/interaction-limits \
-d '{"limit":"limit"}'JavaScript (@octokit/core.js)
await octokit.request('PUT /orgs/{org}/interaction-limits', {
org: 'org',
limit: 'limit'
})
Response
Status: 200 OK
{
"limit": "collaborators_only",
"origin": "organization",
"expires_at": "2018-08-17T04:18:39Z"
}
Validation failed
Status: 422 Unprocessable Entity
Notes
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.
delete /orgs/{org}/interaction-limits
Parámetros
| Name | Type | In | Description |
|---|---|---|---|
accept |
string | header |
Setting to
|
org |
string | path |
Ejemplos de código
Shell
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/orgs/ORG/interaction-limitsJavaScript (@octokit/core.js)
await octokit.request('DELETE /orgs/{org}/interaction-limits', {
org: 'org'
})
Response
Status: 204 No Content
Notes
Repositorio
La API de interacciones de repositorio permite a las personas con acceso administrativo o de propietario restringir temporalmente qué tipo de usuario puede comentar, abrir propuestas, o crear solicitudes de cambios en un repositorio privado. Cuando se habilitan las restricciones, solo el tipo de usuario de GitHub que hayas especificado podrá participar en las interacciones. Las restricciones expiran automáticamente después de una duración definida. Aquí puedes aprender más sobre los tipos de usuario de GitHub:
- Usuarios existentes: Cuando limitas las interacciones a
existing_users, se restringirá temporalmente a los usuarios nuevos con cuentas de menos de 24 horas que no hayan hecho contribuciones anteriormente y que no sean colaboradores en el repositorio. - Solo para contribuyentes: Cuando limitas las interacciones para
contributors_only, se restringirá temporalmente a los usuarios que no hayan hecho contribuciones anteriormente y que no sean colaboradores en el repositorio. - Solo para colaboradores: Cuando limitas las interacciones para
collaborators_only, se restringirá temporalmente a los usuarios que no sean colaboradores en el repositorio.
Si se habilita un límite de interacción para el usuario u organización a la que pertenece el repositorio, éste no podrá cambiarse para el repositorio individual. En su lugar, utiliza las terminales de interacciones de Usuario o de Organización para cambiar el límite de interacción.
Get interaction restrictions for a repository
Shows which type of GitHub user can interact with this repository and when the restriction expires. If there are no restrictions, you will see an empty response.
get /repos/{owner}/{repo}/interaction-limits
Parámetros
| Name | Type | In | Description |
|---|---|---|---|
accept |
string | header |
Setting to
|
owner |
string | path | |
repo |
string | path |
Ejemplos de código
Shell
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/octocat/hello-world/interaction-limitsJavaScript (@octokit/core.js)
await octokit.request('GET /repos/{owner}/{repo}/interaction-limits', {
owner: 'octocat',
repo: 'hello-world'
})
Response
Status: 200 OK
{
"limit": "collaborators_only",
"origin": "repository",
"expires_at": "2018-08-17T04:18:39Z"
}
Notes
Set interaction restrictions for a repository
Temporarily restricts interactions to a certain type of GitHub user within the given repository. You must have owner or admin access to set these restrictions. If an interaction limit is set for the user or organization that owns this repository, you will receive a 409 Conflict response and will not be able to use this endpoint to change the interaction limit for a single repository.
put /repos/{owner}/{repo}/interaction-limits
Parámetros
| Name | Type | In | Description |
|---|---|---|---|
accept |
string | header |
Setting to
|
owner |
string | path | |
repo |
string | path | |
limit |
string | body |
Required. 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 |
string | body |
The duration of the interaction restriction. Can be one of: |
Ejemplos de código
Shell
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/octocat/hello-world/interaction-limits \
-d '{"limit":"limit"}'JavaScript (@octokit/core.js)
await octokit.request('PUT /repos/{owner}/{repo}/interaction-limits', {
owner: 'octocat',
repo: 'hello-world',
limit: 'limit'
})
Response
Status: 200 OK
{
"limit": "collaborators_only",
"origin": "repository",
"expires_at": "2018-08-17T04:18:39Z"
}
Response
Status: 409 Conflict
Notes
Remove interaction restrictions for a repository
Removes all interaction restrictions from the given repository. You must have owner or admin access to remove restrictions. If the interaction limit is set for the user or organization that owns this repository, you will receive a 409 Conflict response and will not be able to use this endpoint to change the interaction limit for a single repository.
delete /repos/{owner}/{repo}/interaction-limits
Parámetros
| Name | Type | In | Description |
|---|---|---|---|
accept |
string | header |
Setting to
|
owner |
string | path | |
repo |
string | path |
Ejemplos de código
Shell
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/octocat/hello-world/interaction-limitsJavaScript (@octokit/core.js)
await octokit.request('DELETE /repos/{owner}/{repo}/interaction-limits', {
owner: 'octocat',
repo: 'hello-world'
})
Response
Status: 204 No Content
Response
Status: 409 Conflict
Notes
Usuario
La API de interacciones de usuario te permite restringir temporalmente qué tipo de usuario puede comentar, abrir propuestas, o crear solicitudes de cambio en tus repositorios públicos. Cuando se habilitan las restricciones, solo el tipo de usuario de GitHub que hayas especificado podrá participar en las interacciones. Las restricciones expiran automáticamente después de una duración definida. Aquí puedes aprender más sobre los tipos de usuario de GitHub:
- Usuarios existentes: Cuando limitas las interacciones a
existing_users, se restringirá temporalmente a los usuarios nuevos con cuentas de menos de 24 horas que no hayan hecho contribuciones anteriormente y que no sean colaboradores de interactuar con tus repositorios. - Solo para contribuyentes: Cuando limitas las interacciones para
contributors_only, se restringirá temporalmente a los usuarios que no hayan hecho contribuciones anteriormente y que no sean colaboradores de interactuar con tus repositorios. - Solo para colaboradores: Cuando limitas las interacciones para
collaborators_only, se restringirá temporalmente a los usuarios que no sean colaboradores de interactuar con tus repositorios.
El configurar el límite de interacción a nivel de usuario sobreescribirá cualquier límite de interacción que se configure para los repositorios individuales que le pertenezcan a éste. Para configurar límites de interacción diferentes para los repositorios individuales que pertenezcan al usuario, utiliza la terminal de interacciones de Repositorio en su lugar.
Get interaction restrictions for your public repositories
Shows which type of GitHub user can interact with your public repositories and when the restriction expires.
get /user/interaction-limits
Ejemplos de código
Shell
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user/interaction-limitsJavaScript (@octokit/core.js)
await octokit.request('GET /user/interaction-limits')
Default response
Status: 200 OK
{
"limit": "collaborators_only",
"origin": "organization",
"expires_at": "2018-08-17T04:18:39Z"
}
Response when there are no restrictions
Status: 204 No Content
Set interaction restrictions for your public repositories
Temporarily restricts which type of GitHub user can interact with your public repositories. Setting the interaction limit at the user level will overwrite any interaction limits that are set for individual repositories owned by the user.
put /user/interaction-limits
Parámetros
| Name | Type | In | Description |
|---|---|---|---|
accept |
string | header |
Setting to
|
limit |
string | body |
Required. 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 |
string | body |
The duration of the interaction restriction. Can be one of: |
Ejemplos de código
Shell
curl \
-X PUT \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user/interaction-limits \
-d '{"limit":"limit"}'JavaScript (@octokit/core.js)
await octokit.request('PUT /user/interaction-limits', {
limit: 'limit'
})
Response
Status: 200 OK
{
"limit": "collaborators_only",
"origin": "user",
"expires_at": "2018-08-17T04:18:39Z"
}
Validation failed
Status: 422 Unprocessable Entity
Remove interaction restrictions from your public repositories
Removes any interaction restrictions from your public repositories.
delete /user/interaction-limits
Ejemplos de código
Shell
curl \
-X DELETE \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/user/interaction-limitsJavaScript (@octokit/core.js)
await octokit.request('DELETE /user/interaction-limits')
Response
Status: 204 No Content

