@@ -18,12 +18,6 @@ topics:
|
||||
{% data reusables.actions.enterprise-beta %}
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** Reusable workflows are currently in beta and subject to change.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
## About reusable workflows
|
||||
|
||||
Rather than copying and pasting deployment jobs from one workflow to another, you can create a reusable workflow that performs the deployment steps. A reusable workflow can be used by another workflow if it meets one of the access requirements described in "[Reusing workflows](/actions/learn-github-actions/reusing-workflows#access-to-reusable-workflows)."
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
title: Reutilizar flujos de trabajo
|
||||
shortTitle: Reutilizar flujos de trabajo
|
||||
intro: Aprende cómo evitar la duplicación al crear un flujo de trabajo reusando los flujos existentes.
|
||||
title: Reusing workflows
|
||||
shortTitle: Reusing workflows
|
||||
intro: Learn how to avoid duplication when creating a workflow by reusing existing workflows.
|
||||
miniTocMaxHeadingLevel: 3
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
ghes: '>=3.4'
|
||||
ghae: issue-4757
|
||||
ghec: '*'
|
||||
type: how_to
|
||||
topics:
|
||||
- Workflows
|
||||
@@ -17,77 +17,120 @@ topics:
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
{% data reusables.actions.ae-beta %}
|
||||
|
||||
{% note %}
|
||||
## Overview
|
||||
|
||||
**Nota:** Los flujos de trabajo reutilizables se encuentran actualmente en beta y están sujetos a cambios.
|
||||
Rather than copying and pasting from one workflow to another, you can make workflows reusable. You and anyone with access to the reusable workflow can then call the reusable workflow from another workflow.
|
||||
|
||||
{% endnote %}
|
||||
Reusing workflows avoids duplication. This makes workflows easier to maintain and allows you to create new workflows more quickly by building on the work of others, just as you do with actions. Workflow reuse also promotes best practice by helping you to use workflows that are well designed, have already been tested, and have been proved to be effective. Your organization can build up a library of reusable workflows that can be centrally maintained.
|
||||
|
||||
## Resumen
|
||||
The diagram below shows three build jobs on the left of the diagram. After each of these jobs completes successfully a dependent job called "Deploy" runs. This job calls a reusable workflow that contains three jobs: "Staging", "Review", and "Production." The "Production" deployment job only runs after the "Staging" job has completed successfully. Using a reusable workflow to run deployment jobs allows you to run those jobs for each build without duplicating code in workflows.
|
||||
|
||||
En vez de copiar y pegar desde un flujo de trabajo hacia otro, puedes hacer flujos de trabajo reutilizables. Tú y cualquiera que tenga acceso a un flujo de trabajo reutilizable pueden entonces llamarlo desde otro flujo.
|
||||

|
||||
|
||||
El reutilizar flujos de trabajo evita la duplicación. Esto hace que los flujos de trabajo se puedan mantener más fácilmente y te permite crear flujos de trabajo nuevos más fácilmente compilando sobre el trabajo de los demás, tal como lo haces con las acciones. La reutilización de flujos de trabajo también promueve las mejores prácticas al ayudarte a utilizar los flujos de trabajo que están bien diseñados, que ya se han probado y cuya efectividad ya se comprobó. Tu organización puede crear una librería de flujos de trabajo reutilizables que puede mantenerse centralmente.
|
||||
A workflow that uses another workflow is referred to as a "caller" workflow. The reusable workflow is a "called" workflow. One caller workflow can use multiple called workflows. Each called workflow is referenced in a single line. The result is that the caller workflow file may contain just a few lines of YAML, but may perform a large number of tasks when it's run. When you reuse a workflow, the entire called workflow is used, just as if it was part of the caller workflow.
|
||||
|
||||
A un flujo de trabajo que utiliza otro flujo de trabajo se le llama flujo de trabajo "llamante". El flujo de trabajo reutilizable es un flujo "llamado". Un flujo de trabajo llamante puede utilizar varios flujos de trabajo llamados. Cada flujo de trabajo llamado se referencia en una línea simple. El resultado es que el archivo de flujo de trabajo llamante podrá contener solo unas cuantas líneas de YAML, pero podría realizar una cantidad grande de tareas cuando se ejecute. Cuando reutilizas un flujo de trabajo, se utiliza todo el flujo de trabajo llamado justo como si fuera parte del flujo de trabajo llamante.
|
||||
If you reuse a workflow from a different repository, any actions in the called workflow run as if they were part of the caller workflow. For example, if the called workflow uses `actions/checkout`, the action checks out the contents of the repository that hosts the caller workflow, not the called workflow.
|
||||
|
||||
Si utilizas un flujo de trabajo desde un repositorio diferente, cualquier acción en el flujo de trabajo llamado se ejecutará como si fuera parte del llamante. Por ejemplo, si el flujo de trabajo llamado utiliza `actions/checkout`, la acción verifica el contenido del repositorio que hospeda el flujo de trabajo llamante y no el llamado.
|
||||
When a reusable workflow is triggered by a caller workflow, the `github` context is always associated with the caller workflow. The called workflow is automatically granted access to `github.token` and `secrets.GITHUB_TOKEN`. For more information about the `github` context, see "[Context and expression syntax for GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#github-context)."
|
||||
|
||||
Cuando un flujo de trabajo llamante activa uno reutilizable, el contexto `github` siempre se asocia con el flujo llamante. The called workflow is automatically granted access to `github.token` and `secrets.GITHUB_TOKEN`. Para obtener más información sobre el contexto `github`, consulta la sección "[Sintaxis de contexto y expresión para GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#github-context)".
|
||||
### Reusable workflows and workflow templates
|
||||
|
||||
## Acceso a los flujos de trabajo reutilizables
|
||||
Workflow templates allow everyone in your organization who has permission to create workflows to do so more quickly and easily. When people create a new workflow, they can choose a template and some or all of the work of writing the workflow will be done for them. Inside workflow templates, you can also reference reusable workflows to make it easy for people to benefit from reusing centrally managed workflow code. If you use a tag or branch name when referencing the reusable workflow then you can ensure that everyone who reuses that workflow will always be using the same YAML code. However, if you reference a reusable workflow by a tag or branch, be sure that you can trust that version of the workflow. For more information, see "[Security hardening for {% data variables.product.prodname_actions %}](/actions/security-guides/security-hardening-for-github-actions#reusing-third-party-workflows)."
|
||||
|
||||
Otros flujos de trabajo pueden usar uno reutilizable si cualquiera de los siguientes casos es cierto:
|
||||
For more information, see "[Creating workflow templates](/actions/learn-github-actions/creating-workflow-templates)."
|
||||
|
||||
* Ambos flujos de trabajo están en el mismo repositorio.
|
||||
* El flujo de trabajo llamado se almacena en un repositorio público.
|
||||
* El flujo de trabajo llamado se almacena en un repositorio interno y los ajustes de dicho repositorio permiten que se acceda a él. Para obtener más información, consulta la sección "[Administrar la configuración de {% data variables.product.prodname_actions %} en un repositorio](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)".
|
||||
## Access to reusable workflows
|
||||
|
||||
## Limitaciones
|
||||
A reusable workflow can be used by another workflow if {% ifversion ghes or ghec or ghae %}any{% else %}either{% endif %} of the following is true:
|
||||
|
||||
* Los flujos de trabajo reutilizables no pueden llamar a otros que también sean reutilizables.
|
||||
* Los flujos de trabajo solo podrán usar a los reutilizables que se encuentren almacenados en un repositorio privado en caso de que estos también se encuentren en el mismo repositorio.
|
||||
* Ninguna variable de ambiente que se configure en un contexto de `env` que se defina a nivel del flujo de trabajo en aquél llamante se propagará al flujo llamado. Para obtener más información sobre el contexto `env`, consulta la sección "[Sintaxis de contexto y expresión para GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#env-context)".
|
||||
* Both workflows are in the same repository.
|
||||
* The called workflow is stored in a public repository.{% ifversion ghes or ghec or ghae %}
|
||||
* The called workflow is stored in an internal repository and the settings for that repository allow it to be accessed. For more information, see "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)."{% endif %}
|
||||
|
||||
Se eliminarán las siguientes limitaciones cuando la reutilización del flujo de trabajo salga del beta:
|
||||
* No puedes configurar la concurrencia de un flujo de trabajo llamado desde el flujo llamante. Para obtener más información sobre `jobs.<job_id>.concurrency`, consulta la sección "[Sintaxis de flujo de trabajo para las GitHub Actions](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idconcurrency)".
|
||||
* El flujo de trabajo llamante no puede acceder a las salidas que genera un flujo de trabajo llamado.
|
||||
## Using runners
|
||||
|
||||
## Crear un flujo de trabajo reutilizable
|
||||
### Using GitHub-hosted runners
|
||||
|
||||
Los flujos de trabajo reutilizables son archivos con formato YAML, muy similares a cualquier otro archivo de flujo de trabajo. Tal como con otros flujos de trabajo, puedes ubicar los reutilizables en el directorio `.github/workflows` de un repositorio. Los subdirectorios del directorio `workflows` no son compatibles.
|
||||
{% ifversion fpt or ghes or ghec %}
|
||||
The assignment of {% data variables.product.prodname_dotcom %}-hosted runners is always evaluated using only the caller's context. Billing for {% data variables.product.prodname_dotcom %}-hosted runners is always associated with the caller. The caller workflow cannot use {% data variables.product.prodname_dotcom %}-hosted runners from the called repository. For more information, see "[About {% data variables.product.prodname_dotcom %}-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners)."
|
||||
{% endif %}
|
||||
{% ifversion ghae %}
|
||||
The assignment of {% data variables.actions.hosted_runner %}s is always evaluated using only the caller's context. Billing for {% data variables.actions.hosted_runner %}s is always associated with the caller. The caller cannot use {% data variables.actions.hosted_runner %}s from the called repository. For more information, see "[About {% data variables.actions.hosted_runner %}s](/github-ae@latest/actions/using-github-hosted-runners/about-ae-hosted-runners)."
|
||||
{% endif %}
|
||||
|
||||
Para que un flujo de trabajo sea reutilizable, los valores de `on` deben incluir `workflow_call`:
|
||||
### Using self-hosted runners
|
||||
|
||||
Called workflows can access self-hosted runners from caller's context. This means that a called workflow can access self-hosted runners that are:
|
||||
* In the caller repository
|
||||
* In the caller repository's organization{% ifversion ghes or ghec or ghae %} or enterprise{% endif %}, provided that the runner has been made available to the caller repository
|
||||
|
||||
## Limitations
|
||||
|
||||
* Reusable workflows can't call other reusable workflows.
|
||||
* Reusable workflows stored within a private repository can only be used by workflows within the same repository.
|
||||
* Any environment variables set in an `env` context defined at the workflow level in the caller workflow are not propagated to the called workflow. For more information about the `env` context, see "[Context and expression syntax for GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#env-context)."
|
||||
* You can't set the concurrency of a called workflow from the caller workflow. For more information about `jobs.<job_id>.concurrency`, see "[Workflow syntax for GitHub Actions](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idconcurrency)."
|
||||
|
||||
## Creating a reusable workflow
|
||||
|
||||
Reusable workflows are YAML-formatted files, very similar to any other workflow file. As with other workflow files, you locate reusable workflows in the `.github/workflows` directory of a repository. Subdirectories of the `workflows` directory are not supported.
|
||||
|
||||
For a workflow to be reusable, the values for `on` must include `workflow_call`:
|
||||
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
```
|
||||
|
||||
Puedes definir entradas y secretos, las cuales pueden pasarse desde el flujo de trabajo llamante y luego utilizarse dentro del flujo llamado. El siguiente ejemplo, desde un flujo de trabajo reutilizable, define dos entradas (llamadas "ring" y "environment") y un secreto (llamado "token"):
|
||||
### Using inputs and secrets in a reusable workflow
|
||||
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ring:
|
||||
description: 'Identifier for the target deployment ring'
|
||||
default: 'ring-0'
|
||||
required: false
|
||||
type: string
|
||||
environment:
|
||||
required: false
|
||||
type: string
|
||||
secrets:
|
||||
token:
|
||||
required: false
|
||||
```
|
||||
You can define inputs and secrets, which can be passed from the caller workflow and then used within the called workflow. There are three stages to using an input or a secret in a reusable workflow.
|
||||
|
||||
Para encontrar los detalles de la sintaxis para definir entradas y secretos, consulta [on.workflow_call.inputs](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callinputs) y [on.workflow_call.secrets](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callsecrets).
|
||||
1. In the reusable workflow, use the `inputs` and `secrets` keywords to define inputs or secrets that will be passed from a caller workflow.
|
||||
{% raw %}
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
username:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
envPAT:
|
||||
required: true
|
||||
```
|
||||
{% endraw %}
|
||||
For details of the syntax for defining inputs and secrets, see [`on.workflow_call.inputs`](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callinputs) and [`on.workflow_call.secrets`](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callsecrets).
|
||||
1. Reference the input or secret in the reusable workflow.
|
||||
|
||||
### Flujo de trabajo reutilizable de ejemplo
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
reusable_workflow_job:
|
||||
runs-on: ubuntu-latest
|
||||
environment: production
|
||||
steps:
|
||||
- uses: ./.github/actions/my-action@v1
|
||||
with:
|
||||
username: ${{ inputs.username }}
|
||||
token: ${{ secrets.envPAT }}
|
||||
```
|
||||
{% endraw %}
|
||||
In the example above, `envPAT` is an environment secret that's been added to the `production` environment. This environment is therefore referenced within the job.
|
||||
|
||||
Este archivo de flujo de trabajo reutilizable llamado `workflow-B.yml` (nos referiremos a él más adelante) toma una secuencia de entrada y un secreto del flujo llamante y lo utiliza en una acción.
|
||||
{% note %}
|
||||
|
||||
**Note**: Environment secrets are encrypted strings that are stored in an environment that you've defined for a repository. Environment secrets are only available to workflow jobs that reference the appropriate environment. For more information, see "[Using environments for deployment](/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-secrets)."
|
||||
|
||||
{% endnote %}
|
||||
|
||||
1. Pass the input or secret from the caller workflow.
|
||||
|
||||
{% indented_data_reference reusables.actions.pass-inputs-to-reusable-workflows spaces=3 %}
|
||||
|
||||
### Example reusable workflow
|
||||
|
||||
This reusable workflow file named `workflow-B.yml` (we'll refer to this later in the [example caller workflow](#example-caller-workflow)) takes an input string and a secret from the caller workflow and uses them in an action.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
@@ -115,36 +158,27 @@ jobs:
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Llamar a un flujo de trabajo reutilizable
|
||||
## Calling a reusable workflow
|
||||
|
||||
Se llama a un flujo de trabajo reutilizable utilizando la palabra clave `uses`. A diferencia de cuando utilizas acciones en un flujo de trabajo, los flujos de trabajo reutilizables se llaman directamente desde un job y no dentro de los pasos de un job.
|
||||
You call a reusable workflow by using the `uses` keyword. Unlike when you are using actions within a workflow, you call reusable workflows directly within a job, and not from within job steps.
|
||||
|
||||
[`jobs.<job_id>.uses`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_iduses)
|
||||
|
||||
Se referencian los archivos de flujo de trabajo reutilizables utilizando la sintaxis:
|
||||
You reference reusable workflow files using the syntax:
|
||||
|
||||
`{owner}/{repo}/{path}/{filename}@{ref}`
|
||||
|
||||
Puedes llamar a flujos de trabajo múltiples, referenciando cada uno en un job separado.
|
||||
You can call multiple workflows, referencing each in a separate job.
|
||||
|
||||
{% data reusables.actions.uses-keyword-example %}
|
||||
|
||||
### Pasar entradas y secretos a un flujo de trabajo reutilizable
|
||||
### Passing inputs and secrets to a reusable workflow
|
||||
|
||||
Utiliza la palabra clave `with` para pasar entradas nombradas al flujo de trabajo llamado. Utiliza la palabra clave `secrets` para pasar los secretos nombrados. Las entradas y secretos que pases deben definirse en el flujo de trabajo llamado. Para las entradas, el tipo de datos del valor de estas debe coincidir con el tipo que se especifica para ellas en el flujo de trabajo llamado (booleano, número o secuencia).
|
||||
{% data reusables.actions.pass-inputs-to-reusable-workflows%}
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
with:
|
||||
username: mona
|
||||
secrets:
|
||||
token: ${{ secrets.TOKEN }}
|
||||
```
|
||||
{% endraw %}
|
||||
### Supported keywords for jobs that call a reusable workflow
|
||||
|
||||
### Palabras clave compatibles con los jobs que llaman a un flujo de trabajo reutilizable
|
||||
|
||||
Cuando llamas a un flujo de trabajo reutilizable, solo puedes utilizar las siguientes palabras clave en el job que contiene la llamada:
|
||||
When you call a reusable workflow, you can only use the following keywords in the job containing the call:
|
||||
|
||||
* [`jobs.<job_id>.name`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idname)
|
||||
* [`jobs.<job_id>.uses`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_iduses)
|
||||
@@ -158,16 +192,16 @@ Cuando llamas a un flujo de trabajo reutilizable, solo puedes utilizar las sigui
|
||||
|
||||
{% note %}
|
||||
|
||||
**Nota:**
|
||||
**Note:**
|
||||
|
||||
* Si no se especifica `jobs.<job_id>.permissions` en el job de llamada, el flujo de trabajo llamado tendrá los permisos predefinidos para el `GITHUB_TOKEN`. Para obtener más información, consulta la sección "[Autenticación en un flujo de trabajo](/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token)".
|
||||
* Los permisos del `GITHUB_TOKEN` que se pasaron del flujo de trabajo llamante solo pueden bajarse de nivel (no elevarse) a través del flujo de trabajo llamado.
|
||||
* If `jobs.<job_id>.permissions` is not specified in the calling job, the called workflow will have the default permissions for the `GITHUB_TOKEN`. For more information, see "[Authentication in a workflow](/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token)."
|
||||
* The `GITHUB_TOKEN` permissions passed from the caller workflow can be only downgraded (not elevated) by the called workflow.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
### Flujo de trabajo llamante de ejemplo
|
||||
### Example caller workflow
|
||||
|
||||
Este archivo de flujo de trabajo llama a otros dos archivos de flujo de trabajo. Al segundo de ellos, `workflow-B.yml` (que se muestra anteriormente), se le pasó una entrada, `username`, y un secreto, `token`.
|
||||
This workflow file calls two workflow files. The second of these, `workflow-B.yml` (shown in the [example reusable workflow](#example-reusable-workflow)), is passed an input (`username`) and a secret (`token`).
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
@@ -191,6 +225,82 @@ jobs:
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Pasos siguientes
|
||||
## Using outputs from a reusable workflow
|
||||
|
||||
Para seguir aprendiendo sobre las {% data variables.product.prodname_actions %}, consulta la sección "[Eventos que activan flujos de trabajo](/actions/learn-github-actions/events-that-trigger-workflows)".
|
||||
A reusable workflow may generate data that you want to use in the caller workflow. To use these outputs, you must specify them as the outputs of the reusable workflow.
|
||||
|
||||
The following reusable workflow has a single job containing two steps. In each of these steps we set a single word as the output: "hello" and "world." In the `outputs` section of the job, we map these step outputs to job outputs called: `output1` and `output2`. In the `on.workflow_call.outputs` section we then define two outputs for the workflow itself, one called `firstword` which we map to `output1`, and one called `secondword` which we map to `output2`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Reusable workflow
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
# Map the workflow outputs to job outputs
|
||||
outputs:
|
||||
firstword:
|
||||
description: "The first output string"
|
||||
value: ${{ jobs.example_job.outputs.output1 }}
|
||||
secondword:
|
||||
description: "The second output string"
|
||||
value: ${{ jobs.example_job.outputs.output2 }}
|
||||
|
||||
jobs:
|
||||
example_job:
|
||||
name: Generate output
|
||||
runs-on: ubuntu-latest
|
||||
# Map the job outputs to step outputs
|
||||
outputs:
|
||||
output1: ${{ steps.step1.outputs.firstword }}
|
||||
output2: ${{ steps.step2.outputs.secondword }}
|
||||
steps:
|
||||
- id: step1
|
||||
run: echo "::set-output name=firstword::hello"
|
||||
- id: step2
|
||||
run: echo "::set-output name=secondword::world"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
We can now use the outputs in the caller workflow, in the same way you would use the outputs from a job within the same workflow. We reference the outputs using the names defined at the workflow level in the reusable workflow: `firstword` and `secondword`. In this workflow, `job1` calls the reusable workflow and `job2` prints the outputs from the reusable workflow ("hello world") to standard output in the workflow log.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Call a reusable workflow and use its outputs
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
job1:
|
||||
uses: octo-org/example-repo/.github/workflows/called-workflow.yml@v1
|
||||
|
||||
job2:
|
||||
runs-on: ubuntu-latest
|
||||
needs: job1
|
||||
steps:
|
||||
- run: echo ${{ needs.job1.outputs.firstword }} ${{ needs.job1.outputs.secondword }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
For more information on using job outputs, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idoutputs)."
|
||||
|
||||
## Monitoring which workflows are being used
|
||||
|
||||
You can use the {% data variables.product.prodname_dotcom %} REST API to monitor how reusable workflows are being used. The `prepared_workflow_job` audit log action is triggered when a workflow job is started. Included in the data recorded are:
|
||||
* `repo` - the organization/repository where the workflow job is located. For a job that calls another workflow, this is the organization/repository of the caller workflow.
|
||||
* `@timestamp` - the date and time that the job was started, in Unix epoch format.
|
||||
* `job_name` - the name of the job that was run.
|
||||
* `job_workflow_ref` - the workflow file that was used, in the form `{owner}/{repo}/{path}/{filename}@{ref}`. For a job that calls another workflow, this identifies the called workflow.
|
||||
|
||||
For information about using the REST API to query the audit log for an organization, see "[Organizations](/rest/reference/orgs#get-the-audit-log-for-an-organization)."
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note**: Audit data for `prepared_workflow_job` can only be viewed using the REST API. It is not visible in the {% data variables.product.prodname_dotcom %} web interface, or included in JSON/CSV exported audit data.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
## Next steps
|
||||
|
||||
To continue learning about {% data variables.product.prodname_actions %}, see "[Events that trigger workflows](/actions/learn-github-actions/events-that-trigger-workflows)."
|
||||
|
||||
@@ -226,6 +226,31 @@ For more information, see "[Reusing workflows](/actions/learn-github-actions/reu
|
||||
|
||||
Required if input is defined for the `on.workflow_call` keyword. The value of this parameter is a string specifying the data type of the input. This must be one of: `boolean`, `number`, or `string`.
|
||||
|
||||
## `on.workflow_call.outputs`
|
||||
|
||||
A map of outputs for a called workflow. Called workflow outputs are available to all downstream jobs in the caller workflow. Each output has an identifier, an optional `description,` and a `value.` The `value` must be set to the value of an output from a job within the called workflow.
|
||||
|
||||
In the example below, two outputs are defined for this reusable workflow: `workflow_output1` and `workflow_output2`. These are mapped to outputs called `job_output1` and `job_output2`, both from a job called `my_job`.
|
||||
|
||||
### Example
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
# Map the workflow outputs to job outputs
|
||||
outputs:
|
||||
workflow_output1:
|
||||
description: "The first job output"
|
||||
value: ${{ jobs.my_job.outputs.job_output1 }}
|
||||
workflow_output2:
|
||||
description: "The second job output"
|
||||
value: ${{ jobs.my_job.outputs.job_output2 }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
For information on how to reference a job output, see [`jobs.<job_id>.outputs`](#jobsjob_idoutputs). For more information, see "[Reusing workflows](/actions/learn-github-actions/reusing-workflows)."
|
||||
|
||||
## `on.workflow_call.secrets`
|
||||
|
||||
A map of the secrets that can be used in the called workflow.
|
||||
|
||||
@@ -48,9 +48,10 @@ When you have configured {% data variables.product.product_location %} to use {%
|
||||
Any VM that you use for {% data variables.product.prodname_dependabot %} runners must meet the requirements for self-hosted runners. In addition, they must meet the following requirements.
|
||||
|
||||
- Linux operating system
|
||||
- The following dependencies installed:
|
||||
- Docker running as the same user as the self-hosted runner application
|
||||
- Git
|
||||
- Git installed
|
||||
- Docker installed with access for the runner users:
|
||||
- We recommend installing Docker in rootless mode and configuring the runners to access Docker without `root` privileges.
|
||||
- Alternatively, install Docker and give the runner users raised privileges to run Docker.
|
||||
|
||||
The CPU and memory requirements will depend on the number of concurrent runners you deploy on a given VM. As guidance, we have successfully set up 20 runners on a single 2 CPU 8GB machine, but ultimately, your CPU and memory requirements will heavily depend on the repositories being updated. Some ecosystems will require more resources than others.
|
||||
|
||||
@@ -72,6 +73,15 @@ If you specify more than 14 concurrent runners on a VM, you must also update the
|
||||
|
||||
1. Provision self-hosted runners, at the repository, organization, or enterprise account level. For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners)" and "[Adding self-hosted runners](/actions/hosting-your-own-runners/adding-self-hosted-runners)."
|
||||
|
||||
2. Verify that the self-hosted runners meet the requirements for {% data variables.product.prodname_dependabot %} before assigning a `dependabot` label to each runner you want {% data variables.product.prodname_dependabot %} to use. For more information, see "[Using labels with self-hosted runners](/actions/hosting-your-own-runners/using-labels-with-self-hosted-runners#assigning-a-label-to-a-self-hosted-runner)."
|
||||
2. Set up the self-hosted runners with the requirements described above. For example, on a VM running Ubuntu 20.04 you would:
|
||||
|
||||
3. Optionally, enable workflows triggered by {% data variables.product.prodname_dependabot %} to use more than read-only permissions and to have access to any secrets that are normally available. For more information, see "[Troubleshooting {% data variables.product.prodname_actions %} for your enterprise](/admin/github-actions/advanced-configuration-and-troubleshooting/troubleshooting-github-actions-for-your-enterprise#enabling-workflows-triggered-by-dependabot-access-to-dependabot-secrets-and-increased-permissions)."
|
||||
- Verify that Git is installed: `command -v git`
|
||||
- Install Docker and ensure that the runner users have access to Docker. For more information, see the Docker documentation.
|
||||
- [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
|
||||
- Recommended approach: [Run the Docker daemon as a non-root user (Rootless mode)](https://docs.docker.com/engine/security/rootless/)
|
||||
- Alternative approach: [Manage Docker as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
|
||||
- Verify that the runners have access to the public internet and can only access the internal networks that {% data variables.product.prodname_dependabot %} needs.
|
||||
|
||||
3. Assign a `dependabot` label to each runner you want {% data variables.product.prodname_dependabot %} to use. For more information, see "[Using labels with self-hosted runners](/actions/hosting-your-own-runners/using-labels-with-self-hosted-runners#assigning-a-label-to-a-self-hosted-runner)."
|
||||
|
||||
4. Optionally, enable workflows triggered by {% data variables.product.prodname_dependabot %} to use more than read-only permissions and to have access to any secrets that are normally available. For more information, see "[Troubleshooting {% data variables.product.prodname_actions %} for your enterprise](/admin/github-actions/advanced-configuration-and-troubleshooting/troubleshooting-github-actions-for-your-enterprise#enabling-workflows-triggered-by-dependabot-access-to-dependabot-secrets-and-increased-permissions)."
|
||||
|
||||
@@ -23,7 +23,6 @@ topics:
|
||||
- Actions
|
||||
- Repositories
|
||||
---
|
||||
<!--For this article in earlier GHES versions, see /content/github/finding-security-vulnerabilities-and-errors-in-your-code-->
|
||||
|
||||
{% data reusables.code-scanning.beta %}
|
||||
{% data reusables.code-scanning.enterprise-enable-code-scanning-actions %}
|
||||
@@ -34,13 +33,21 @@ You decide how to generate {% data variables.product.prodname_code_scanning %} a
|
||||
|
||||
{% data reusables.code-scanning.enabling-options %}
|
||||
|
||||
{% ifversion ghae %}
|
||||
## Prerequisites
|
||||
|
||||
Before setting up {% data variables.product.prodname_code_scanning %} for a repository, you must ensure that there is at least one self-hosted {% data variables.product.prodname_actions %} runner available to the repository.
|
||||
|
||||
Enterprise owners, organization and repository administrators can add self-hosted runners. For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners)" and "[Adding self-hosted runners](/actions/hosting-your-own-runners/adding-self-hosted-runners)."
|
||||
{% endif %}
|
||||
|
||||
## Setting up {% data variables.product.prodname_code_scanning %} using actions
|
||||
|
||||
{% ifversion fpt or ghec %}Using actions to run {% data variables.product.prodname_code_scanning %} will use minutes. For more information, see "[About billing for {% data variables.product.prodname_actions %}](/billing/managing-billing-for-github-actions/about-billing-for-github-actions)."{% endif %}
|
||||
|
||||
{% data reusables.repositories.navigate-to-repo %}
|
||||
{% data reusables.repositories.sidebar-security %}
|
||||
3. To the right of "{% data variables.product.prodname_code_scanning_capc %} alerts", click **Set up {% data variables.product.prodname_code_scanning %}**. {% ifversion fpt or ghes > 3.0 or ghae-next or ghec %}If {% data variables.product.prodname_code_scanning %} is missing, you need to ask an organization owner or repository administrator to enable {% data variables.product.prodname_GH_advanced_security %}. For more information, see "[Managing security and analysis settings for your organization](/organizations/keeping-your-organization-secure/managing-security-and-analysis-settings-for-your-organization)" or "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)."{% endif %}
|
||||
1. To the right of "{% data variables.product.prodname_code_scanning_capc %} alerts", click **Set up {% data variables.product.prodname_code_scanning %}**. {% ifversion fpt or ghes > 3.0 or ghae-next or ghec %}If {% data variables.product.prodname_code_scanning %} is missing, you need to ask an organization owner or repository administrator to enable {% data variables.product.prodname_GH_advanced_security %}. For more information, see "[Managing security and analysis settings for your organization](/organizations/keeping-your-organization-secure/managing-security-and-analysis-settings-for-your-organization)" or "[Managing security and analysis settings for your repository](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository)."{% endif %}
|
||||

|
||||
4. Under "Get started with {% data variables.product.prodname_code_scanning %}", click **Set up this workflow** on the {% data variables.product.prodname_codeql_workflow %} or on a third-party workflow.
|
||||
Workflows are only displayed if they are relevant for the programming languages detected in the repository. The {% data variables.product.prodname_codeql_workflow %} is always displayed, but the "Set up this workflow" button is only enabled if {% data variables.product.prodname_codeql %} analysis supports the languages present in the repository.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Personalizar tu codespace
|
||||
intro: '{% data variables.product.prodname_codespaces %} es un ambiente dedicado para ti. Puedes configurar tus repositorios con un contenedor de dev para definir su ambiente predeterminado de Codespaces y personalizar tu experiencia de desarrollo a lo largo de tus codespaces con dotfiles y sincronización de ajustes.'
|
||||
title: Customizing your codespace
|
||||
intro: '{% data variables.product.prodname_codespaces %} is a dedicated environment for you. You can configure your repositories with a dev container to define their default Codespaces environment, and personalize your development experience across all of your codespaces with dotfiles and Settings Sync.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -10,8 +10,10 @@ redirect_from:
|
||||
topics:
|
||||
- Codespaces
|
||||
children:
|
||||
- /configuring-codespaces-for-your-project
|
||||
- /personalizing-codespaces-for-your-account
|
||||
- /changing-the-machine-type-for-your-codespace
|
||||
- /setting-your-default-editor-for-codespaces
|
||||
- /setting-your-default-region-for-codespaces
|
||||
- /prebuilding-codespaces-for-your-project
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ topics:
|
||||
- Codespaces
|
||||
- Fundamentals
|
||||
- Developer
|
||||
shortTitle: Create a codespace
|
||||
---
|
||||
|
||||
## About codespace creation
|
||||
|
||||
@@ -13,6 +13,7 @@ topics:
|
||||
- Codespaces
|
||||
- Fundamentals
|
||||
- Developer
|
||||
shortTitle: Delete a codespace
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ topics:
|
||||
- Codespaces
|
||||
- Fundamentals
|
||||
- Developer
|
||||
shortTitle: Develop in a codespace
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ children:
|
||||
- /using-codespaces-for-pull-requests
|
||||
- /deleting-a-codespace
|
||||
- /forwarding-ports-in-your-codespace
|
||||
- /changing-the-machine-type-for-your-codespace
|
||||
- /using-codespaces-in-visual-studio-code
|
||||
- /using-codespaces-with-github-cli
|
||||
---
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Administrar tus codespaces
|
||||
intro: 'Puedes utilizar los ajustes de {% data variables.product.prodname_github_codespaces %} para administrar la información que pudiera necesitar tu codespace.'
|
||||
title: Managing your codespaces
|
||||
intro: 'You can use {% data variables.product.prodname_github_codespaces %} settings to manage information that your codespace might need.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -14,7 +14,5 @@ children:
|
||||
- /managing-repository-access-for-your-codespaces
|
||||
- /reviewing-your-security-logs-for-codespaces
|
||||
- /managing-gpg-verification-for-codespaces
|
||||
- /setting-your-default-editor-for-codespaces
|
||||
- /setting-your-default-region-for-codespaces
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ You can create a codespace from any branch or commit in your repository and begi
|
||||
|
||||
To customize the runtimes and tools in your codespace, you can create a custom configuration to define an environment (or _dev container_) that is specific for your repository. Using a dev container allows you to specify a Docker environment for development with a well-defined tool and runtime stack that can reference an image, Dockerfile, or docker-compose. This means that anyone using the repository will have the same tools available to them when they create a codespace.
|
||||
|
||||
If you don't do any custom configuration, {% data variables.product.prodname_codespaces %} will clone your repository into an environment with the default codespace image that includes many tools, languages, and runtime environments. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
If you don't do any custom configuration, {% data variables.product.prodname_codespaces %} will clone your repository into an environment with the default codespace image that includes many tools, languages, and runtime environments. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
|
||||
You can also personalize aspects of your codespace environment by using a public [dotfiles](https://dotfiles.github.io/tutorials/) repository and [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync). Personalization can include shell preferences, additional tools, editor settings, and VS Code extensions. For more information, see "[Customizing your codespace](/codespaces/customizing-your-codespace)".
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: 'Configurar tu proyecto para {% data variables.product.prodname_codespaces %}'
|
||||
intro: 'Aprende cómo iniciar con los {% data variables.product.prodname_codespaces %}, incluyendo cómo configurar y hacer ajustes para lenguajes específicos.'
|
||||
title: 'Setting up your repository for {% data variables.product.prodname_codespaces %}'
|
||||
allowTitleToDifferFromFilename: true
|
||||
intro: 'Learn how to get started with {% data variables.product.prodname_codespaces %}, including set up and configuration for specific languages.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -8,6 +9,8 @@ versions:
|
||||
redirect_from:
|
||||
- /codespaces/getting-started-with-codespaces
|
||||
children:
|
||||
- /configuring-codespaces-for-your-project
|
||||
- /setting-up-your-project-for-codespaces
|
||||
- /setting-up-your-nodejs-project-for-codespaces
|
||||
- /setting-up-your-dotnet-project-for-codespaces
|
||||
- /setting-up-your-java-project-for-codespaces
|
||||
|
||||
@@ -11,6 +11,8 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- Codespaces
|
||||
hasExperimentalAlternative: true
|
||||
hidden: true
|
||||
---
|
||||
|
||||
|
||||
@@ -36,14 +38,14 @@ When you create a codespace, your project is created on a remote VM that is dedi
|
||||
|
||||
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
|
||||
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
## Step 2: Add a dev container to your codespace from a template
|
||||
|
||||
The default codespaces container comes with the latest .NET version and common tools preinstalled. However, we encourage you to set up a custom container so you can tailor the tools and scripts that run as part of codespace creation to your project's needs and ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
|
||||
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Introduction to dev containers
|
||||
](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- Codespaces
|
||||
hasExperimentalAlternative: true
|
||||
hidden: true
|
||||
---
|
||||
|
||||
|
||||
@@ -35,14 +37,14 @@ When you create a codespace, your project is created on a remote VM that is dedi
|
||||
|
||||
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
|
||||
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
## Step 2: Add a dev container to your codespace from a template
|
||||
|
||||
The default codespaces container comes with the latest Java version, package managers (Maven, Gradle), and other common tools preinstalled. However, we recommend that you set up a custom container to define the tools and scripts that your project needs. This will ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
|
||||
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
{% data reusables.codespaces.command-palette-container %}
|
||||
|
||||
@@ -14,6 +14,8 @@ topics:
|
||||
- Developer
|
||||
- Node
|
||||
- JavaScript
|
||||
hasExperimentalAlternative: true
|
||||
hidden: true
|
||||
---
|
||||
|
||||
|
||||
@@ -40,13 +42,13 @@ When you create a codespace, your project is created on a remote VM that is dedi
|
||||
|
||||
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
|
||||
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
## Step 2: Add a dev container to your codespace from a template
|
||||
|
||||
The default codespaces container will support running Node.js projects like [vscode-remote-try-node](https://github.com/microsoft/vscode-remote-try-node) out of the box. By setting up a custom container you can customize the tools and scripts that run as part of codespace creation and ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
|
||||
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
|
||||
{% data reusables.codespaces.command-palette-container %}
|
||||
3. For this example, click **Node.js**. If you need additional features you can select any container that’s specific to Node or a combination of tools such as Node and MongoDB.
|
||||
|
||||
@@ -13,6 +13,8 @@ topics:
|
||||
- Codespaces
|
||||
- Developer
|
||||
- Python
|
||||
hasExperimentalAlternative: true
|
||||
hidden: true
|
||||
---
|
||||
|
||||
|
||||
@@ -40,14 +42,14 @@ When you create a codespace, your project is created on a remote VM that is dedi
|
||||
|
||||
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
|
||||
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
## Step 2: Add a dev container to your codespace from a template
|
||||
|
||||
The default codespaces container comes with the latest Python version, package managers (pip, Miniconda), and other common tools preinstalled. However, we recommend that you set up a custom container to define the tools and scripts that your project needs. This will ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
|
||||
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Configuring Codespaces for your project](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
{% data reusables.codespaces.command-palette-container %}
|
||||
|
||||
@@ -77,7 +77,8 @@ To search for specific events, use the `action` qualifier in your query. Actions
|
||||
| [`secret_scanning_new_repos`](#secret_scanning_new_repos-category-actions) | Contains organization-level configuration activities for secret scanning for new repositories created in the organization. {% ifversion fpt or ghec %}
|
||||
| [`sponsors`](#sponsors-category-actions) | Contains all events related to sponsor buttons (see "[Displaying a sponsor button in your repository](/articles/displaying-a-sponsor-button-in-your-repository)"){% endif %}
|
||||
| [`team`](#team-category-actions) | Contains all activities related to teams in your organization.
|
||||
| [`team_discussions`](#team_discussions-category-actions) | Contains activities related to managing team discussions for an organization.
|
||||
| [`team_discussions`](#team_discussions-category-actions) | Contains activities related to managing team discussions for an organization.{% ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
| [`workflows`](#workflows-category-actions) | Contains activities related to {% data variables.product.prodname_actions %} workflows.{% endif %}
|
||||
|
||||
You can search for specific sets of actions using these terms. For example:
|
||||
|
||||
@@ -743,10 +744,11 @@ For more information, see "[Managing the publication of {% data variables.produc
|
||||
| `disable` | Triggered when an organization owner disables team discussions for an organization. For more information, see "[Disabling team discussions for your organization](/articles/disabling-team-discussions-for-your-organization)."
|
||||
| `enable` | Triggered when an organization owner enables team discussions for an organization.
|
||||
|
||||
{% ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
### `workflows` category actions
|
||||
|
||||
{% data reusables.actions.actions-audit-events-workflow %}
|
||||
|
||||
{% endif %}
|
||||
## Further reading
|
||||
|
||||
- "[Keeping your organization secure](/articles/keeping-your-organization-secure)"{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5146 %}
|
||||
|
||||
@@ -5,9 +5,9 @@ intro: Learn how to avoid duplication when creating a workflow by reusing existi
|
||||
miniTocMaxHeadingLevel: 3
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
ghes: '>=3.4'
|
||||
ghae: issue-4757
|
||||
ghec: '*'
|
||||
type: how_to
|
||||
topics:
|
||||
- Workflows
|
||||
@@ -17,17 +17,15 @@ topics:
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
{% data reusables.actions.ae-beta %}
|
||||
|
||||
{% note %}
|
||||
## Overview
|
||||
|
||||
**Note:** Reusable workflows are currently in beta and subject to change.
|
||||
Rather than copying and pasting from one workflow to another, you can make workflows reusable. You and anyone with access to the reusable workflow can then call the reusable workflow from another workflow.
|
||||
|
||||
{% endnote %}
|
||||
Reusing workflows avoids duplication. This makes workflows easier to maintain and allows you to create new workflows more quickly by building on the work of others, just as you do with actions. Workflow reuse also promotes best practice by helping you to use workflows that are well designed, have already been tested, and have been proved to be effective. Your organization can build up a library of reusable workflows that can be centrally maintained.
|
||||
|
||||
## 概要
|
||||
The diagram below shows three build jobs on the left of the diagram. After each of these jobs completes successfully a dependent job called "Deploy" runs. This job calls a reusable workflow that contains three jobs: "Staging", "Review", and "Production." The "Production" deployment job only runs after the "Staging" job has completed successfully. Using a reusable workflow to run deployment jobs allows you to run those jobs for each build without duplicating code in workflows.
|
||||
|
||||
Rather than copying and pasting from one workflow to another, you can make workflows reusable. You and anyone with access to the reusable workflow can then call the reusable workflow from another workflow.
|
||||
|
||||
Reusing workflows avoids duplication. This makes workflows easier to maintain and allows you to create new workflows more quickly by building on the work of others, just as you do with actions. Workflow reuse also promotes best practice by helping you to use workflows that are well designed, have already been tested, and have been proved to be effective. Your organization can build up a library of reusable workflows that can be centrally maintained.
|
||||

|
||||
|
||||
A workflow that uses another workflow is referred to as a "caller" workflow. The reusable workflow is a "called" workflow. One caller workflow can use multiple called workflows. Each called workflow is referenced in a single line. The result is that the caller workflow file may contain just a few lines of YAML, but may perform a large number of tasks when it's run. When you reuse a workflow, the entire called workflow is used, just as if it was part of the caller workflow.
|
||||
|
||||
@@ -35,23 +33,43 @@ If you reuse a workflow from a different repository, any actions in the called w
|
||||
|
||||
When a reusable workflow is triggered by a caller workflow, the `github` context is always associated with the caller workflow. The called workflow is automatically granted access to `github.token` and `secrets.GITHUB_TOKEN`. For more information about the `github` context, see "[Context and expression syntax for GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#github-context)."
|
||||
|
||||
### Reusable workflows and workflow templates
|
||||
|
||||
Workflow templates allow everyone in your organization who has permission to create workflows to do so more quickly and easily. When people create a new workflow, they can choose a template and some or all of the work of writing the workflow will be done for them. Inside workflow templates, you can also reference reusable workflows to make it easy for people to benefit from reusing centrally managed workflow code. If you use a tag or branch name when referencing the reusable workflow then you can ensure that everyone who reuses that workflow will always be using the same YAML code. However, if you reference a reusable workflow by a tag or branch, be sure that you can trust that version of the workflow. For more information, see "[Security hardening for {% data variables.product.prodname_actions %}](/actions/security-guides/security-hardening-for-github-actions#reusing-third-party-workflows)."
|
||||
|
||||
For more information, see "[Creating workflow templates](/actions/learn-github-actions/creating-workflow-templates)."
|
||||
|
||||
## Access to reusable workflows
|
||||
|
||||
A reusable workflow can be used by another workflow if any of the following is true:
|
||||
A reusable workflow can be used by another workflow if {% ifversion ghes or ghec or ghae %}any{% else %}either{% endif %} of the following is true:
|
||||
|
||||
* Both workflows are in the same repository.
|
||||
* The called workflow is stored in a public repository.
|
||||
* The called workflow is stored in an internal repository and the settings for that repository allow it to be accessed. For more information, see "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)."
|
||||
* The called workflow is stored in a public repository.{% ifversion ghes or ghec or ghae %}
|
||||
* The called workflow is stored in an internal repository and the settings for that repository allow it to be accessed. For more information, see "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)."{% endif %}
|
||||
|
||||
## 制限事項
|
||||
## Using runners
|
||||
|
||||
### Using GitHub-hosted runners
|
||||
|
||||
{% ifversion fpt or ghes or ghec %}
|
||||
The assignment of {% data variables.product.prodname_dotcom %}-hosted runners is always evaluated using only the caller's context. Billing for {% data variables.product.prodname_dotcom %}-hosted runners is always associated with the caller. The caller workflow cannot use {% data variables.product.prodname_dotcom %}-hosted runners from the called repository. For more information, see "[About {% data variables.product.prodname_dotcom %}-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners)."
|
||||
{% endif %}
|
||||
{% ifversion ghae %}
|
||||
The assignment of {% data variables.actions.hosted_runner %}s is always evaluated using only the caller's context. Billing for {% data variables.actions.hosted_runner %}s is always associated with the caller. The caller cannot use {% data variables.actions.hosted_runner %}s from the called repository. For more information, see "[About {% data variables.actions.hosted_runner %}s](/github-ae@latest/actions/using-github-hosted-runners/about-ae-hosted-runners)."
|
||||
{% endif %}
|
||||
|
||||
### Using self-hosted runners
|
||||
|
||||
Called workflows can access self-hosted runners from caller's context. This means that a called workflow can access self-hosted runners that are:
|
||||
* In the caller repository
|
||||
* In the caller repository's organization{% ifversion ghes or ghec or ghae %} or enterprise{% endif %}, provided that the runner has been made available to the caller repository
|
||||
|
||||
## Limitations
|
||||
|
||||
* Reusable workflows can't call other reusable workflows.
|
||||
* Reusable workflows stored within a private repository can only be used by workflows within the same repository.
|
||||
* Any environment variables set in an `env` context defined at the workflow level in the caller workflow are not propagated to the called workflow. For more information about the `env` context, see "[Context and expression syntax for GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#env-context)."
|
||||
|
||||
The following limitations will be removed when workflow reuse moves out of beta:
|
||||
* You can't set the concurrency of a called workflow from the caller workflow. For more information about `jobs.<job_id>.concurrency`, see "[Workflow syntax for GitHub Actions](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idconcurrency)."
|
||||
* Outputs generated by a called workflow can't be accessed by the caller workflow.
|
||||
|
||||
## Creating a reusable workflow
|
||||
|
||||
@@ -64,30 +82,55 @@ on:
|
||||
workflow_call:
|
||||
```
|
||||
|
||||
You can define inputs and secrets, which can be passed from the caller workflow and then used within the called workflow. The following example, from a reusable workflow, defines two inputs (called "ring" and "environment") and one secret (called "token"):
|
||||
### Using inputs and secrets in a reusable workflow
|
||||
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ring:
|
||||
description: 'Identifier for the target deployment ring'
|
||||
default: 'ring-0'
|
||||
required: false
|
||||
type: string
|
||||
environment:
|
||||
required: false
|
||||
type: string
|
||||
secrets:
|
||||
token:
|
||||
required: false
|
||||
```
|
||||
You can define inputs and secrets, which can be passed from the caller workflow and then used within the called workflow. There are three stages to using an input or a secret in a reusable workflow.
|
||||
|
||||
For details of the syntax for defining inputs and secrets, see [on.workflow_call.inputs](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callinputs) and [on.workflow_call.secrets](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callsecrets).
|
||||
1. In the reusable workflow, use the `inputs` and `secrets` keywords to define inputs or secrets that will be passed from a caller workflow.
|
||||
{% raw %}
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
username:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
envPAT:
|
||||
required: true
|
||||
```
|
||||
{% endraw %}
|
||||
For details of the syntax for defining inputs and secrets, see [`on.workflow_call.inputs`](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callinputs) and [`on.workflow_call.secrets`](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callsecrets).
|
||||
1. Reference the input or secret in the reusable workflow.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
reusable_workflow_job:
|
||||
runs-on: ubuntu-latest
|
||||
environment: production
|
||||
steps:
|
||||
- uses: ./.github/actions/my-action@v1
|
||||
with:
|
||||
username: ${{ inputs.username }}
|
||||
token: ${{ secrets.envPAT }}
|
||||
```
|
||||
{% endraw %}
|
||||
In the example above, `envPAT` is an environment secret that's been added to the `production` environment. This environment is therefore referenced within the job.
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note**: Environment secrets are encrypted strings that are stored in an environment that you've defined for a repository. Environment secrets are only available to workflow jobs that reference the appropriate environment. For more information, see "[Using environments for deployment](/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-secrets)."
|
||||
|
||||
{% endnote %}
|
||||
|
||||
1. Pass the input or secret from the caller workflow.
|
||||
|
||||
{% indented_data_reference reusables.actions.pass-inputs-to-reusable-workflows spaces=3 %}
|
||||
|
||||
### Example reusable workflow
|
||||
|
||||
This reusable workflow file named `workflow-B.yml` (we'll refer to this later) takes an input string and a secret from the caller workflow and uses them in an action.
|
||||
This reusable workflow file named `workflow-B.yml` (we'll refer to this later in the [example caller workflow](#example-caller-workflow)) takes an input string and a secret from the caller workflow and uses them in an action.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
@@ -121,7 +164,7 @@ You call a reusable workflow by using the `uses` keyword. Unlike when you are us
|
||||
|
||||
[`jobs.<job_id>.uses`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_iduses)
|
||||
|
||||
You reference reusable workflow files using the syntax:
|
||||
You reference reusable workflow files using the syntax:
|
||||
|
||||
`{owner}/{repo}/{path}/{filename}@{ref}`
|
||||
|
||||
@@ -131,16 +174,7 @@ You can call multiple workflows, referencing each in a separate job.
|
||||
|
||||
### Passing inputs and secrets to a reusable workflow
|
||||
|
||||
Use the `with` keyword in a job to pass named inputs to the called workflow. Use the `secrets` keyword to pass named secrets. The inputs and secrets you pass must be defined in the called workflow. For inputs, the data type of the input value must match the type specified for that input in the called workflow (boolean, number, or string).
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
with:
|
||||
username: mona
|
||||
secrets:
|
||||
token: ${{ secrets.TOKEN }}
|
||||
```
|
||||
{% endraw %}
|
||||
{% data reusables.actions.pass-inputs-to-reusable-workflows%}
|
||||
|
||||
### Supported keywords for jobs that call a reusable workflow
|
||||
|
||||
@@ -158,16 +192,16 @@ When you call a reusable workflow, you can only use the following keywords in th
|
||||
|
||||
{% note %}
|
||||
|
||||
**注釈:**
|
||||
**Note:**
|
||||
|
||||
* If `jobs.<job_id>.permissions` is not specified in the calling job, the called workflow will have the default permissions for the `GITHUB_TOKEN`. 詳しい情報については、「[ワークフローでの認証](/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token)」を参照してください。
|
||||
* If `jobs.<job_id>.permissions` is not specified in the calling job, the called workflow will have the default permissions for the `GITHUB_TOKEN`. For more information, see "[Authentication in a workflow](/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token)."
|
||||
* The `GITHUB_TOKEN` permissions passed from the caller workflow can be only downgraded (not elevated) by the called workflow.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
### Example caller workflow
|
||||
|
||||
This workflow file calls two workflow files. The second of these, `workflow-B.yml` (shown above), is passed an input, `username`, and a secret, `token`.
|
||||
This workflow file calls two workflow files. The second of these, `workflow-B.yml` (shown in the [example reusable workflow](#example-reusable-workflow)), is passed an input (`username`) and a secret (`token`).
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
@@ -191,6 +225,82 @@ jobs:
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## 次のステップ
|
||||
## Using outputs from a reusable workflow
|
||||
|
||||
A reusable workflow may generate data that you want to use in the caller workflow. To use these outputs, you must specify them as the outputs of the reusable workflow.
|
||||
|
||||
The following reusable workflow has a single job containing two steps. In each of these steps we set a single word as the output: "hello" and "world." In the `outputs` section of the job, we map these step outputs to job outputs called: `output1` and `output2`. In the `on.workflow_call.outputs` section we then define two outputs for the workflow itself, one called `firstword` which we map to `output1`, and one called `secondword` which we map to `output2`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Reusable workflow
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
# Map the workflow outputs to job outputs
|
||||
outputs:
|
||||
firstword:
|
||||
description: "The first output string"
|
||||
value: ${{ jobs.example_job.outputs.output1 }}
|
||||
secondword:
|
||||
description: "The second output string"
|
||||
value: ${{ jobs.example_job.outputs.output2 }}
|
||||
|
||||
jobs:
|
||||
example_job:
|
||||
name: Generate output
|
||||
runs-on: ubuntu-latest
|
||||
# Map the job outputs to step outputs
|
||||
outputs:
|
||||
output1: ${{ steps.step1.outputs.firstword }}
|
||||
output2: ${{ steps.step2.outputs.secondword }}
|
||||
steps:
|
||||
- id: step1
|
||||
run: echo "::set-output name=firstword::hello"
|
||||
- id: step2
|
||||
run: echo "::set-output name=secondword::world"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
We can now use the outputs in the caller workflow, in the same way you would use the outputs from a job within the same workflow. We reference the outputs using the names defined at the workflow level in the reusable workflow: `firstword` and `secondword`. In this workflow, `job1` calls the reusable workflow and `job2` prints the outputs from the reusable workflow ("hello world") to standard output in the workflow log.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Call a reusable workflow and use its outputs
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
job1:
|
||||
uses: octo-org/example-repo/.github/workflows/called-workflow.yml@v1
|
||||
|
||||
job2:
|
||||
runs-on: ubuntu-latest
|
||||
needs: job1
|
||||
steps:
|
||||
- run: echo ${{ needs.job1.outputs.firstword }} ${{ needs.job1.outputs.secondword }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
For more information on using job outputs, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idoutputs)."
|
||||
|
||||
## Monitoring which workflows are being used
|
||||
|
||||
You can use the {% data variables.product.prodname_dotcom %} REST API to monitor how reusable workflows are being used. The `prepared_workflow_job` audit log action is triggered when a workflow job is started. Included in the data recorded are:
|
||||
* `repo` - the organization/repository where the workflow job is located. For a job that calls another workflow, this is the organization/repository of the caller workflow.
|
||||
* `@timestamp` - the date and time that the job was started, in Unix epoch format.
|
||||
* `job_name` - the name of the job that was run.
|
||||
* `job_workflow_ref` - the workflow file that was used, in the form `{owner}/{repo}/{path}/{filename}@{ref}`. For a job that calls another workflow, this identifies the called workflow.
|
||||
|
||||
For information about using the REST API to query the audit log for an organization, see "[Organizations](/rest/reference/orgs#get-the-audit-log-for-an-organization)."
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note**: Audit data for `prepared_workflow_job` can only be viewed using the REST API. It is not visible in the {% data variables.product.prodname_dotcom %} web interface, or included in JSON/CSV exported audit data.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
## Next steps
|
||||
|
||||
To continue learning about {% data variables.product.prodname_actions %}, see "[Events that trigger workflows](/actions/learn-github-actions/events-that-trigger-workflows)."
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Customizing your codespace
|
||||
intro: '{% data variables.product.prodname_codespaces %} は自分専用の環境に整えることができます。 You can configure your repositories with a dev container to define their default Codespaces environment, and personalize your development experience across all of your codespaces with dotfiles and Settings Sync.'
|
||||
intro: '{% data variables.product.prodname_codespaces %} is a dedicated environment for you. You can configure your repositories with a dev container to define their default Codespaces environment, and personalize your development experience across all of your codespaces with dotfiles and Settings Sync.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -10,8 +10,10 @@ redirect_from:
|
||||
topics:
|
||||
- Codespaces
|
||||
children:
|
||||
- /configuring-codespaces-for-your-project
|
||||
- /personalizing-codespaces-for-your-account
|
||||
- /changing-the-machine-type-for-your-codespace
|
||||
- /setting-your-default-editor-for-codespaces
|
||||
- /setting-your-default-region-for-codespaces
|
||||
- /prebuilding-codespaces-for-your-project
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: codespace で開発する
|
||||
intro: '専用のクラウド環境でプロジェクト開発を開始するための codespace を作成します。 転送されたポートを使用してアプリケーションを実行したり、{% data variables.product.prodname_vscode %} 内の Codespaces を使用したりすることもできます。'
|
||||
title: Developing in a codespace
|
||||
intro: 'Create a codespace to get started with developing your project inside a dedicated cloud environment. You can use forwarded ports to run your application and even use codespaces inside {% data variables.product.prodname_vscode %}'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -15,8 +15,7 @@ children:
|
||||
- /using-codespaces-for-pull-requests
|
||||
- /deleting-a-codespace
|
||||
- /forwarding-ports-in-your-codespace
|
||||
- /changing-the-machine-type-for-your-codespace
|
||||
- /using-codespaces-in-visual-studio-code
|
||||
- /using-codespaces-with-github-cli
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Codespaces を管理する
|
||||
intro: '{% data variables.product.prodname_github_codespaces %} 設定を使用して、codespace に必要な情報を管理できます。'
|
||||
title: Managing your codespaces
|
||||
intro: 'You can use {% data variables.product.prodname_github_codespaces %} settings to manage information that your codespace might need.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -14,7 +14,5 @@ children:
|
||||
- /managing-repository-access-for-your-codespaces
|
||||
- /reviewing-your-security-logs-for-codespaces
|
||||
- /managing-gpg-verification-for-codespaces
|
||||
- /setting-your-default-editor-for-codespaces
|
||||
- /setting-your-default-region-for-codespaces
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: 'Setting up your project for {% data variables.product.prodname_codespaces %}'
|
||||
intro: '特定の言語のセットアップや構成など、{% data variables.product.prodname_codespaces %} の使用方法を学びます。'
|
||||
title: 'Setting up your repository for {% data variables.product.prodname_codespaces %}'
|
||||
allowTitleToDifferFromFilename: true
|
||||
intro: 'Learn how to get started with {% data variables.product.prodname_codespaces %}, including set up and configuration for specific languages.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -8,6 +9,8 @@ versions:
|
||||
redirect_from:
|
||||
- /codespaces/getting-started-with-codespaces
|
||||
children:
|
||||
- /configuring-codespaces-for-your-project
|
||||
- /setting-up-your-project-for-codespaces
|
||||
- /setting-up-your-nodejs-project-for-codespaces
|
||||
- /setting-up-your-dotnet-project-for-codespaces
|
||||
- /setting-up-your-java-project-for-codespaces
|
||||
|
||||
@@ -77,7 +77,8 @@ To search for specific events, use the `action` qualifier in your query. Actions
|
||||
| [`secret_scanning_new_repos`](#secret_scanning_new_repos-category-actions) | Contains organization-level configuration activities for secret scanning for new repositories created in the organization. {% ifversion fpt or ghec %}
|
||||
| [`sponsors`](#sponsors-category-actions) | Contains all events related to sponsor buttons (see "[Displaying a sponsor button in your repository](/articles/displaying-a-sponsor-button-in-your-repository)"){% endif %}
|
||||
| [`team`](#team-category-actions) | Contains all activities related to teams in your organization.
|
||||
| [`team_discussions`](#team_discussions-category-actions) | Contains activities related to managing team discussions for an organization.
|
||||
| [`team_discussions`](#team_discussions-category-actions) | Contains activities related to managing team discussions for an organization.{% ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
| [`workflows`](#workflows-category-actions) | Contains activities related to {% data variables.product.prodname_actions %} workflows.{% endif %}
|
||||
|
||||
You can search for specific sets of actions using these terms. For example:
|
||||
|
||||
@@ -743,10 +744,11 @@ For more information, see "[Managing the publication of {% data variables.produc
|
||||
| `disable` | Triggered when an organization owner disables team discussions for an organization. For more information, see "[Disabling team discussions for your organization](/articles/disabling-team-discussions-for-your-organization)."
|
||||
| `enable` | Triggered when an organization owner enables team discussions for an organization.
|
||||
|
||||
{% ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
### `workflows` category actions
|
||||
|
||||
{% data reusables.actions.actions-audit-events-workflow %}
|
||||
|
||||
{% endif %}
|
||||
## Further reading
|
||||
|
||||
- "[Keeping your organization secure](/articles/keeping-your-organization-secure)"{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5146 %}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
title: Usando o OpenID Connect com fluxos de trabalho reutilizáveis
|
||||
shortTitle: Usando o OpenID Connect com fluxos de trabalho reutilizáveis
|
||||
intro: Você pode usar fluxos de trabalho reutilizáveis com o OIDC para padronizar e melhorar as suas etapas de implantação.
|
||||
title: Using OpenID Connect with reusable workflows
|
||||
shortTitle: Using OpenID Connect with reusable workflows
|
||||
intro: 'You can use reusable workflows with OIDC to standardize and security harden your deployment steps.'
|
||||
miniTocMaxHeadingLevel: 3
|
||||
redirect_from:
|
||||
- /actions/deployment/security-hardening-your-deployments/using-oidc-with-your-reusable-workflows
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghae: issue-4757-and-5856
|
||||
ghae: 'issue-4757-and-5856'
|
||||
ghec: '*'
|
||||
type: how_to
|
||||
topics:
|
||||
@@ -18,27 +18,21 @@ topics:
|
||||
{% data reusables.actions.enterprise-beta %}
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
|
||||
{% note %}
|
||||
## About reusable workflows
|
||||
|
||||
**Observação:** Os fluxos de trabalho reutilizáveis estão atualmente na versão beta e sujeitos a alterações.
|
||||
Rather than copying and pasting deployment jobs from one workflow to another, you can create a reusable workflow that performs the deployment steps. A reusable workflow can be used by another workflow if it meets one of the access requirements described in "[Reusing workflows](/actions/learn-github-actions/reusing-workflows#access-to-reusable-workflows)."
|
||||
|
||||
{% endnote %}
|
||||
When combined with OpenID Connect (OIDC), reusable workflows let you enforce consistent deployments across your repository, organization, or enterprise. You can do this by defining trust conditions on cloud roles based on reusable workflows.
|
||||
|
||||
## Sobre fluxos de trabalho reutilizáveis
|
||||
In order to create trust conditions based on reusable workflows, your cloud provider must support custom claims for `job_workflow_ref`. This allows your cloud provider to identify which repository the job originally came from. If your cloud provider only supports the standard claims (_audience_ and _subject_), it will not be able to determine that the job originated from the reusable workflow repository. Cloud providers that support `job_workflow_ref` include Google Cloud Platform and HashiCorp Vault.
|
||||
|
||||
Em vez de copiar e colar trabalhos de implantação de um fluxo de trabalho para outro, é possível criar um fluxo de trabalho reutilizável que executa as etapas de implantação. Um fluxo de trabalho reutilizável pode ser usado por outro fluxo de trabalho se ele cumprir um dos requisitos de acesso descritos em "[Reutilizando os fluxos de trabalho](/actions/learn-github-actions/reusing-workflows#access-to-reusable-workflows)".
|
||||
Before proceeding, you should be familiar with the concepts of [reusable workflows](/actions/learn-github-actions/reusing-workflows) and [OpenID Connect](/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect).
|
||||
|
||||
Quando combinado com o OpenID Connect (OIDC), os fluxos de trabalho reutilizáveis permitem que você aplique implantações consistentes no seu repositório, organização ou empresa. Você pode fazer isso definindo condições de confiança nas funções da nuvem com base em fluxos de trabalho reutilizáveis.
|
||||
## How the token works with reusable workflows
|
||||
|
||||
Para criar condições de confiança com base em fluxos de trabalho reutilizáveis, o seu provedor de nuvem deve ser compatível com reivindicações personalizadas para `job_workflow_ref`. Isso permite que seu provedor de nuvem identifique de qual repositório veio originalmente. Se o seu provedor de nuvem é compatível apenas as reivindicações padrão (_audiência_ e _assunto_), não poderá determinar que o trabalho teve origem no repositório do fluxo de trabalho reutilizável. Os provedores de nuvem que sao compatíveis com `job_workflow_ref` incluem Google Cloud Platform e HashiCorp Vault.
|
||||
During a workflow run, {% data variables.product.prodname_dotcom %}'s OIDC provider presents a OIDC token to the cloud provider which contains information about the job. If that job is part of a reusable workflow, the token will include the standard claims that contain information about the calling workflow, and will also include a custom claim called `job_workflow_ref` that contains information about the called workflow.
|
||||
|
||||
Antes de prosseguir, você deve estar familiarizado com os conceitos de [fluxos de trabalho reutilizáveis](/actions/learn-github-actions/reusing-workflows) e [OpenID Connect](/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect).
|
||||
|
||||
## Como o token funciona com fluxos de trabalho reutilizáveis
|
||||
|
||||
Durante uma execução de um fluxo de trabalho, o provedor do OIDC de {% data variables.product.prodname_dotcom %} apresenta um token de OIDC para o provedor de nuvem que contém informações sobre o trabalho. Se esse trabalho faz parte de um fluxo de trabalho reutilizável, o token incluirá as reclamações padrão que contêm informações sobre o fluxo de trabalho de chamadas e também incluirá uma reivindicação personalizada denominada `job_workflow_ref` que contém informações sobre o fluxo de trabalho chamado.
|
||||
|
||||
Por exemplo, o token do OIDC a seguir é para um trabalho que fazia parte de um fluxo de trabalho chamado. O `workflow`, `ref` e outros atributos descrevem o fluxo de trabalho da chamada, enquanto `job_workflow_ref` refere-se ao fluxo de trabalho chamado:
|
||||
For example, the following OIDC token is for a job that was part of a called workflow. The `workflow`, `ref`, and other attributes describe the caller workflow, while `job_workflow_ref` refers to the called workflow:
|
||||
|
||||
```yaml{:copy}
|
||||
{
|
||||
@@ -72,30 +66,30 @@ Por exemplo, o token do OIDC a seguir é para um trabalho que fazia parte de um
|
||||
}
|
||||
```
|
||||
|
||||
Se o seu fluxo de trabalho reutilizável executa etapas de implantação, ele, de modo geral, irá precisar de acesso a um função de nuvem específica, e você deverá permitir que qualquer repositório da sua organização chame esse fluxo de trabalho reutilizável. Para permitir isso, você criará uma condição de confiança que permite qualquer repositório e fluxo de trabalho de chamadas, e, em seguida, irá filtrar a organização e o fluxo de trabalho chamado. Veja a próxima seção para obter alguns exemplos.
|
||||
If your reusable workflow performs deployment steps, then it will typically need access to a specific cloud role, and you might want to allow any repository in your organization to call that reusable workflow. To permit this, you'll create the trust condition that allows any repository and any caller workflow, and then filter on the organization and the called workflow. See the next section for some examples.
|
||||
|
||||
## Exemplos
|
||||
## Examples
|
||||
|
||||
**Filtragem para fluxos de trabalho reutilizáveis dentro de um repositório específico**
|
||||
**Filtering for reusable workflows within a specific repository**
|
||||
|
||||
É possível configurar uma reivindicação personalizada que filtra para qualquer fluxo de trabalho reutilizável em um repositório específico. Neste exemplo, a execução do fluxo de trabalho deve ter sido originada de um trabalho definido em um fluxo de trabalho reutilizável no repositório `octo-org/octo-automation`, e em qualquer repositório que pertença à organização `octo-org`.
|
||||
You can configure a custom claim that filters for any reusable workflow in a specific repository. In this example, the workflow run must have originated from a job defined in a reusable workflow in the `octo-org/octo-automation` repository, and in any repository that is owned by the `octo-org` organization.
|
||||
|
||||
- **Assunto**:
|
||||
- Sintaxe: `repo:ORG_NAME/*`
|
||||
- Exemplo: `repo:octo-org/*`
|
||||
- **Subject**:
|
||||
- Syntax: `repo:ORG_NAME/*`
|
||||
- Example: `repo:octo-org/*`
|
||||
|
||||
- **Reivindicação personalizada**:
|
||||
- Sintaxe: `job_workflow_ref:ORG_NAME/REPO_NAME`
|
||||
- Exemplo: `job_workflow_ref:octo-org/octo-automation@*`
|
||||
- **Custom claim**:
|
||||
- Syntax: `job_workflow_ref:ORG_NAME/REPO_NAME`
|
||||
- Example: `job_workflow_ref:octo-org/octo-automation@*`
|
||||
|
||||
**Filtrando um fluxo de trabalho específico reutilizável em um ref específico**
|
||||
**Filtering for a specific reusable workflow at a specific ref**
|
||||
|
||||
Você pode configurar uma reivindicação personalizada que filtra um fluxo de trabalho específico reutilizável. Neste exemplo, a execução do fluxo de trabalho deve ter origem em um trabalho definido no fluxo de trabalho reutilizável `octo-org/octo-automation/.github/workflows/deployment.yml` e em qualquer repositório que pertença à organização `octo-org`.
|
||||
You can configure a custom claim that filters for a specific reusable workflow. In this example, the workflow run must have originated from a job defined in the reusable workflow `octo-org/octo-automation/.github/workflows/deployment.yml`, and in any repository that is owned by the `octo-org` organization.
|
||||
|
||||
- **Assunto**:
|
||||
- Sintaxe: `repo:ORG_NAME/*`
|
||||
- Exemplo: `repo:octo-org/*`
|
||||
- **Subject**:
|
||||
- Syntax: `repo:ORG_NAME/*`
|
||||
- Example: `repo:octo-org/*`
|
||||
|
||||
- **Reivindicação personalizada**:
|
||||
- Syntax: `job_workflow_ref:ORG_NAME/REPO_NAME/.github/workflows/WORKFLOW_FILE@ref`
|
||||
- Examplo: `job_workflow_ref:octo-org/octo-automation/.github/workflows/deployment.yml@ 10040c56a8c0253d69db7c1f26a0d227275512e2`
|
||||
- **Custom claim**:
|
||||
- Syntax: `job_workflow_ref:ORG_NAME/REPO_NAME/.github/workflows/WORKFLOW_FILE@ref`
|
||||
- Example: `job_workflow_ref:octo-org/octo-automation/.github/workflows/deployment.yml@ 10040c56a8c0253d69db7c1f26a0d227275512e2`
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
---
|
||||
title: Reutilizando fluxos de trabalho
|
||||
shortTitle: Reutilizando fluxos de trabalho
|
||||
intro: Aprenda a evitar a duplicação ao criar um fluxo de trabalho reutilizando os fluxos de trabalho existentes.
|
||||
title: Reusing workflows
|
||||
shortTitle: Reusing workflows
|
||||
intro: Learn how to avoid duplication when creating a workflow by reusing existing workflows.
|
||||
miniTocMaxHeadingLevel: 3
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
ghes: '>=3.4'
|
||||
ghae: issue-4757
|
||||
ghec: '*'
|
||||
type: how_to
|
||||
topics:
|
||||
- Workflows
|
||||
@@ -17,77 +17,120 @@ topics:
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
{% data reusables.actions.ae-beta %}
|
||||
|
||||
{% note %}
|
||||
## Overview
|
||||
|
||||
**Observação:** Os fluxos de trabalho reutilizáveis estão atualmente na versão beta e sujeitos a alterações.
|
||||
Rather than copying and pasting from one workflow to another, you can make workflows reusable. You and anyone with access to the reusable workflow can then call the reusable workflow from another workflow.
|
||||
|
||||
{% endnote %}
|
||||
Reusing workflows avoids duplication. This makes workflows easier to maintain and allows you to create new workflows more quickly by building on the work of others, just as you do with actions. Workflow reuse also promotes best practice by helping you to use workflows that are well designed, have already been tested, and have been proved to be effective. Your organization can build up a library of reusable workflows that can be centrally maintained.
|
||||
|
||||
## Visão Geral
|
||||
The diagram below shows three build jobs on the left of the diagram. After each of these jobs completes successfully a dependent job called "Deploy" runs. This job calls a reusable workflow that contains three jobs: "Staging", "Review", and "Production." The "Production" deployment job only runs after the "Staging" job has completed successfully. Using a reusable workflow to run deployment jobs allows you to run those jobs for each build without duplicating code in workflows.
|
||||
|
||||
Em vez de copiar e colar de um fluxo de trabalho para outro, você pode tornar os fluxos de trabalho reutilizáveis. Você e qualquer pessoa com acesso ao fluxo de trabalho reutilizável pode chamar o fluxo de trabalho reutilizável a partir de outro fluxo de trabalho.
|
||||

|
||||
|
||||
A reutilização dosfluxos de trabalho evita duplicação. Isso torna os fluxos de trabalho mais fáceis de manter e permite que você crie novos fluxos de trabalho mais rapidamente, desenvolvendo sobre o trabalho dos outros, assim como você faz com ações. A reutilização do fluxo de trabalho também promove práticas recomendadas, ajudando você a usar os fluxos de trabalho bem projetados, Já foram testados e sua eficiência é comprovada. Sua organização pode criar uma biblioteca de fluxos de trabalho reutilizáveis que pode ser mantida centralmente.
|
||||
A workflow that uses another workflow is referred to as a "caller" workflow. The reusable workflow is a "called" workflow. One caller workflow can use multiple called workflows. Each called workflow is referenced in a single line. The result is that the caller workflow file may contain just a few lines of YAML, but may perform a large number of tasks when it's run. When you reuse a workflow, the entire called workflow is used, just as if it was part of the caller workflow.
|
||||
|
||||
Um fluxo de trabalho que usa outro fluxo de trabalho é referido como um fluxo de trabalho "de chamada". O fluxo de trabalho reutilizável é um fluxo de trabalho "chamado". Um fluxo de trabalho de chamada pode usar vários fluxos de trabalho chamados. Cada fluxo de trabalho chamado é referenciado em uma única linha. O resultado é que o arquivo de fluxo de trabalho de chamadas pode conter apenas algumas linhas de YAML mas pode executar um grande número de tarefas quando for executado. Quando um fluxo de trabalho é reutilizado, todo o fluxo de trabalho chamado é usado, como se fosse parte do fluxo de trabalho de chamada.
|
||||
If you reuse a workflow from a different repository, any actions in the called workflow run as if they were part of the caller workflow. For example, if the called workflow uses `actions/checkout`, the action checks out the contents of the repository that hosts the caller workflow, not the called workflow.
|
||||
|
||||
Se você reutilizar um fluxo de trabalho de um repositório diferente, todas as ações no fluxo de trabalho chamado são como se fizessem parte do fluxo de trabalho de chamada. Por exemplo, se o fluxo de trabalho chamado usar `ações/checkout`, a ação verifica o conteúdo do repositório que hospeda o fluxo de trabalho de chamada, não o fluxo de trabalho chamado.
|
||||
When a reusable workflow is triggered by a caller workflow, the `github` context is always associated with the caller workflow. The called workflow is automatically granted access to `github.token` and `secrets.GITHUB_TOKEN`. For more information about the `github` context, see "[Context and expression syntax for GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#github-context)."
|
||||
|
||||
Quando um fluxo de trabalho reutilizável é acionado por um fluxo de trabalho de chamadas, o contexto `github` está sempre associado ao fluxo de trabalho de chamada. O fluxo de trabalho chamado tem acesso automaticamente a `github.token` e `secrets.GITHUB_TOKEN`. Para obter mais informações sobre o contexto do github ``, consulte "[Contexto e sintaxe de expressão para o GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#github-context)".
|
||||
### Reusable workflows and workflow templates
|
||||
|
||||
## Acesso a fluxos de trabalho reutilizáveis
|
||||
Workflow templates allow everyone in your organization who has permission to create workflows to do so more quickly and easily. When people create a new workflow, they can choose a template and some or all of the work of writing the workflow will be done for them. Inside workflow templates, you can also reference reusable workflows to make it easy for people to benefit from reusing centrally managed workflow code. If you use a tag or branch name when referencing the reusable workflow then you can ensure that everyone who reuses that workflow will always be using the same YAML code. However, if you reference a reusable workflow by a tag or branch, be sure that you can trust that version of the workflow. For more information, see "[Security hardening for {% data variables.product.prodname_actions %}](/actions/security-guides/security-hardening-for-github-actions#reusing-third-party-workflows)."
|
||||
|
||||
Um fluxo de trabalho reutilizável pode ser usado por outro fluxo de trabalho se qualquer uma das seguintes opções for verdadeira:
|
||||
For more information, see "[Creating workflow templates](/actions/learn-github-actions/creating-workflow-templates)."
|
||||
|
||||
* Ambos os fluxos de trabalho estão no mesmo repositório.
|
||||
* O fluxo de trabalho chamado é armazenado em um repositório público.
|
||||
* O fluxo de trabalho chamado é armazenado em um repositório interno e as configurações para esse repositório permitem que ele seja acessado. Para obter mais informações, consulte "[Gerenciar configurações de {% data variables.product.prodname_actions %} para um repositório](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)".
|
||||
## Access to reusable workflows
|
||||
|
||||
## Limitações
|
||||
A reusable workflow can be used by another workflow if {% ifversion ghes or ghec or ghae %}any{% else %}either{% endif %} of the following is true:
|
||||
|
||||
* Os fluxos de trabalho reutilizáveis não podem chamar outros fluxos de trabalho reutilizáveis.
|
||||
* Os fluxos de trabalho armazenados dentro de um repositório privado só podem ser usados por fluxos de trabalho dentro do mesmo repositório.
|
||||
* Qualquer variável de ambiente definida em um contexto `env` definido no nível do fluxo de trabalho no fluxo de trabalho da chamada não é propagada para o fluxo de trabalho chamado. Para obter mais informações sobre o contexto `env`, consulte "[Contexto e sintaxe de expressão para o GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#env-context)".
|
||||
* Both workflows are in the same repository.
|
||||
* The called workflow is stored in a public repository.{% ifversion ghes or ghec or ghae %}
|
||||
* The called workflow is stored in an internal repository and the settings for that repository allow it to be accessed. For more information, see "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)."{% endif %}
|
||||
|
||||
As seguintes limitações serão removidas quando o fluxo de trabalho reutilizar os movimentos do beta:
|
||||
* Não é possível definir a concorrência de um fluxo de trabalho chamado a partir do fluxo de trabalho de chamada. Para obter mais informações sobre `trabalhos.<job_id>.concurrency`, consulte "[Sintaxe de fluxo de trabalho para o GitHub Actions](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idconcurrency)".
|
||||
* As saídas geradas por um fluxo de trabalho chamado não podem ser acessadas pelo fluxo de trabalho de chamada.
|
||||
## Using runners
|
||||
|
||||
## Criar um fluxo de trabalho reutilizável
|
||||
### Using GitHub-hosted runners
|
||||
|
||||
Os fluxos de trabalho reutilizáveis são arquivos formatados com YAML, muito semelhantes a qualquer outro arquivo de fluxo de trabalho. Como em outros arquivos de fluxo de trabalho, você localiza os fluxos de trabalho reutilizáveis no diretório `.github/workflows` de um repositório. Os subdiretórios do diretóriio `fluxos de trabalho` não são compatíveis.
|
||||
{% ifversion fpt or ghes or ghec %}
|
||||
The assignment of {% data variables.product.prodname_dotcom %}-hosted runners is always evaluated using only the caller's context. Billing for {% data variables.product.prodname_dotcom %}-hosted runners is always associated with the caller. The caller workflow cannot use {% data variables.product.prodname_dotcom %}-hosted runners from the called repository. For more information, see "[About {% data variables.product.prodname_dotcom %}-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners)."
|
||||
{% endif %}
|
||||
{% ifversion ghae %}
|
||||
The assignment of {% data variables.actions.hosted_runner %}s is always evaluated using only the caller's context. Billing for {% data variables.actions.hosted_runner %}s is always associated with the caller. The caller cannot use {% data variables.actions.hosted_runner %}s from the called repository. For more information, see "[About {% data variables.actions.hosted_runner %}s](/github-ae@latest/actions/using-github-hosted-runners/about-ae-hosted-runners)."
|
||||
{% endif %}
|
||||
|
||||
Para que um fluxo de trabalho seja reutilizável, os valores de `on` devem incluir `workflow_call`:
|
||||
### Using self-hosted runners
|
||||
|
||||
Called workflows can access self-hosted runners from caller's context. This means that a called workflow can access self-hosted runners that are:
|
||||
* In the caller repository
|
||||
* In the caller repository's organization{% ifversion ghes or ghec or ghae %} or enterprise{% endif %}, provided that the runner has been made available to the caller repository
|
||||
|
||||
## Limitations
|
||||
|
||||
* Reusable workflows can't call other reusable workflows.
|
||||
* Reusable workflows stored within a private repository can only be used by workflows within the same repository.
|
||||
* Any environment variables set in an `env` context defined at the workflow level in the caller workflow are not propagated to the called workflow. For more information about the `env` context, see "[Context and expression syntax for GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#env-context)."
|
||||
* You can't set the concurrency of a called workflow from the caller workflow. For more information about `jobs.<job_id>.concurrency`, see "[Workflow syntax for GitHub Actions](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idconcurrency)."
|
||||
|
||||
## Creating a reusable workflow
|
||||
|
||||
Reusable workflows are YAML-formatted files, very similar to any other workflow file. As with other workflow files, you locate reusable workflows in the `.github/workflows` directory of a repository. Subdirectories of the `workflows` directory are not supported.
|
||||
|
||||
For a workflow to be reusable, the values for `on` must include `workflow_call`:
|
||||
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
```
|
||||
|
||||
Você pode definir entradas e segredos, que podem ser passados do fluxo de trabalho de de chamada e, em seguida, usados no fluxo de trabalho chamado. O exemplo a seguir de um fluxo de trabalho reutilizável define duas entradas (denominadas de "anel" e "ambiente") e um segredo (denominado "token"):
|
||||
### Using inputs and secrets in a reusable workflow
|
||||
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ring:
|
||||
description: 'Identifier for the target deployment ring'
|
||||
default: 'ring-0'
|
||||
required: false
|
||||
type: string
|
||||
environment:
|
||||
required: false
|
||||
type: string
|
||||
secrets:
|
||||
token:
|
||||
required: false
|
||||
```
|
||||
You can define inputs and secrets, which can be passed from the caller workflow and then used within the called workflow. There are three stages to using an input or a secret in a reusable workflow.
|
||||
|
||||
Para obter informações sobre a sintaxe e definir entradas e segredos, consulte [on.workflow_call.inputs](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callinputs) e [on.workflow_call.secrets](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callsecrets).
|
||||
1. In the reusable workflow, use the `inputs` and `secrets` keywords to define inputs or secrets that will be passed from a caller workflow.
|
||||
{% raw %}
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
username:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
envPAT:
|
||||
required: true
|
||||
```
|
||||
{% endraw %}
|
||||
For details of the syntax for defining inputs and secrets, see [`on.workflow_call.inputs`](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callinputs) and [`on.workflow_call.secrets`](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callsecrets).
|
||||
1. Reference the input or secret in the reusable workflow.
|
||||
|
||||
### Exemplo de fluxo de trabalho reutilizável
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
reusable_workflow_job:
|
||||
runs-on: ubuntu-latest
|
||||
environment: production
|
||||
steps:
|
||||
- uses: ./.github/actions/my-action@v1
|
||||
with:
|
||||
username: ${{ inputs.username }}
|
||||
token: ${{ secrets.envPAT }}
|
||||
```
|
||||
{% endraw %}
|
||||
In the example above, `envPAT` is an environment secret that's been added to the `production` environment. This environment is therefore referenced within the job.
|
||||
|
||||
Este arquivo de fluxo de trabalho reutilizável denominado `workflow-B. ml` (vamos mencioná-lo mais adiante) recebe uma string de entrada e um segredo do fluxo de trabalho de chamada e os usa em uma ação.
|
||||
{% note %}
|
||||
|
||||
**Note**: Environment secrets are encrypted strings that are stored in an environment that you've defined for a repository. Environment secrets are only available to workflow jobs that reference the appropriate environment. For more information, see "[Using environments for deployment](/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-secrets)."
|
||||
|
||||
{% endnote %}
|
||||
|
||||
1. Pass the input or secret from the caller workflow.
|
||||
|
||||
{% indented_data_reference reusables.actions.pass-inputs-to-reusable-workflows spaces=3 %}
|
||||
|
||||
### Example reusable workflow
|
||||
|
||||
This reusable workflow file named `workflow-B.yml` (we'll refer to this later in the [example caller workflow](#example-caller-workflow)) takes an input string and a secret from the caller workflow and uses them in an action.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
@@ -115,36 +158,27 @@ jobs:
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Chamando um fluxo de trabalho reutilizável
|
||||
## Calling a reusable workflow
|
||||
|
||||
Você chama um fluxo de trabalho reutilizável usando a chave `usa`. Ao contrário de quando você usa ações em um fluxo de trabalho, você chama os fluxos de trabalho reutilizáveis diretamente em um trabalho, e não de dentro de etapas de trabalho.
|
||||
You call a reusable workflow by using the `uses` keyword. Unlike when you are using actions within a workflow, you call reusable workflows directly within a job, and not from within job steps.
|
||||
|
||||
[`jobs.<job_id>.uses`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_iduses)
|
||||
|
||||
Você faz referência a arquivos reutilizáveis do fluxo de trabalho usando a sintaxe:
|
||||
You reference reusable workflow files using the syntax:
|
||||
|
||||
`{owner}/{repo}/{path}/{filename}@{ref}`
|
||||
|
||||
Você pode chamar vários fluxos de trabalho, fazendo referência a cada um em um trabalho separado.
|
||||
You can call multiple workflows, referencing each in a separate job.
|
||||
|
||||
{% data reusables.actions.uses-keyword-example %}
|
||||
|
||||
### Passando entradas e segredos para um fluxo de trabalho reutilizável
|
||||
### Passing inputs and secrets to a reusable workflow
|
||||
|
||||
Use a palavra-chave `com` em uma tarefa para passar entradas nomeadas para o fluxo de trabalho chamado. Use a palavra-chave `segredos` para passar segredos nomeados. As entradas e segredos que você passou devem ser definidos no fluxo de trabalho chamado. Para as entradas, o tipo de dado do valor de entrada deve corresponder ao tipo especificado para essa entrada no fluxo de trabalho chamado (booleano, número ou string).
|
||||
{% data reusables.actions.pass-inputs-to-reusable-workflows%}
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
with:
|
||||
username: mona
|
||||
secrets:
|
||||
token: ${{ secrets.TOKEN }}
|
||||
```
|
||||
{% endraw %}
|
||||
### Supported keywords for jobs that call a reusable workflow
|
||||
|
||||
### Palavras-chave compatíveis com trabalhos que chamam um fluxo de trabalho reutilizável
|
||||
|
||||
Ao chamar um fluxo de trabalho reutilizável, você só poderá usar as palavras-chave a seguir no trabalho que contém a chamada:
|
||||
When you call a reusable workflow, you can only use the following keywords in the job containing the call:
|
||||
|
||||
* [`jobs.<job_id>.name`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idname)
|
||||
* [`jobs.<job_id>.uses`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_iduses)
|
||||
@@ -158,16 +192,16 @@ Ao chamar um fluxo de trabalho reutilizável, você só poderá usar as palavras
|
||||
|
||||
{% note %}
|
||||
|
||||
**Observação:**
|
||||
**Note:**
|
||||
|
||||
* Se `jobs.<job_id>.permissions` não for especificado no trabalho de chamadas, o fluxo de trabalho chamado terá as permissões padrão para o `GITHUB_TOKEN`. Para obter mais informações, consulte "[Autenticação em um fluxo de trabalho](/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token)".
|
||||
* As permissões de `GITHUB_TOKEN` passadas do fluxo de trabalho de de cahamada só podem ser rebaixadas (não elevadas) pelo fluxo de trabalho chamado.
|
||||
* If `jobs.<job_id>.permissions` is not specified in the calling job, the called workflow will have the default permissions for the `GITHUB_TOKEN`. For more information, see "[Authentication in a workflow](/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token)."
|
||||
* The `GITHUB_TOKEN` permissions passed from the caller workflow can be only downgraded (not elevated) by the called workflow.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
### Exemplo de fluxo de trabalho de chamada
|
||||
### Example caller workflow
|
||||
|
||||
Este arquivo de fluxo de trabalho chama dois arquivos de fluxo de trabalho. O segundo deles: `workflow-B.yml` (exibido acima) passa uma entrada, `nome de usuário` e um segredo, `token`.
|
||||
This workflow file calls two workflow files. The second of these, `workflow-B.yml` (shown in the [example reusable workflow](#example-reusable-workflow)), is passed an input (`username`) and a secret (`token`).
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
@@ -191,6 +225,82 @@ jobs:
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Próximas etapas
|
||||
## Using outputs from a reusable workflow
|
||||
|
||||
Para continuar aprendendo sobre {% data variables.product.prodname_actions %}, consulte "[Eventos que desencadeiam fluxos de trabalho](/actions/learn-github-actions/events-that-trigger-workflows)".
|
||||
A reusable workflow may generate data that you want to use in the caller workflow. To use these outputs, you must specify them as the outputs of the reusable workflow.
|
||||
|
||||
The following reusable workflow has a single job containing two steps. In each of these steps we set a single word as the output: "hello" and "world." In the `outputs` section of the job, we map these step outputs to job outputs called: `output1` and `output2`. In the `on.workflow_call.outputs` section we then define two outputs for the workflow itself, one called `firstword` which we map to `output1`, and one called `secondword` which we map to `output2`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Reusable workflow
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
# Map the workflow outputs to job outputs
|
||||
outputs:
|
||||
firstword:
|
||||
description: "The first output string"
|
||||
value: ${{ jobs.example_job.outputs.output1 }}
|
||||
secondword:
|
||||
description: "The second output string"
|
||||
value: ${{ jobs.example_job.outputs.output2 }}
|
||||
|
||||
jobs:
|
||||
example_job:
|
||||
name: Generate output
|
||||
runs-on: ubuntu-latest
|
||||
# Map the job outputs to step outputs
|
||||
outputs:
|
||||
output1: ${{ steps.step1.outputs.firstword }}
|
||||
output2: ${{ steps.step2.outputs.secondword }}
|
||||
steps:
|
||||
- id: step1
|
||||
run: echo "::set-output name=firstword::hello"
|
||||
- id: step2
|
||||
run: echo "::set-output name=secondword::world"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
We can now use the outputs in the caller workflow, in the same way you would use the outputs from a job within the same workflow. We reference the outputs using the names defined at the workflow level in the reusable workflow: `firstword` and `secondword`. In this workflow, `job1` calls the reusable workflow and `job2` prints the outputs from the reusable workflow ("hello world") to standard output in the workflow log.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Call a reusable workflow and use its outputs
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
job1:
|
||||
uses: octo-org/example-repo/.github/workflows/called-workflow.yml@v1
|
||||
|
||||
job2:
|
||||
runs-on: ubuntu-latest
|
||||
needs: job1
|
||||
steps:
|
||||
- run: echo ${{ needs.job1.outputs.firstword }} ${{ needs.job1.outputs.secondword }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
For more information on using job outputs, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idoutputs)."
|
||||
|
||||
## Monitoring which workflows are being used
|
||||
|
||||
You can use the {% data variables.product.prodname_dotcom %} REST API to monitor how reusable workflows are being used. The `prepared_workflow_job` audit log action is triggered when a workflow job is started. Included in the data recorded are:
|
||||
* `repo` - the organization/repository where the workflow job is located. For a job that calls another workflow, this is the organization/repository of the caller workflow.
|
||||
* `@timestamp` - the date and time that the job was started, in Unix epoch format.
|
||||
* `job_name` - the name of the job that was run.
|
||||
* `job_workflow_ref` - the workflow file that was used, in the form `{owner}/{repo}/{path}/{filename}@{ref}`. For a job that calls another workflow, this identifies the called workflow.
|
||||
|
||||
For information about using the REST API to query the audit log for an organization, see "[Organizations](/rest/reference/orgs#get-the-audit-log-for-an-organization)."
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note**: Audit data for `prepared_workflow_job` can only be viewed using the REST API. It is not visible in the {% data variables.product.prodname_dotcom %} web interface, or included in JSON/CSV exported audit data.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
## Next steps
|
||||
|
||||
To continue learning about {% data variables.product.prodname_actions %}, see "[Events that trigger workflows](/actions/learn-github-actions/events-that-trigger-workflows)."
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: 'Limites de uso, cobrança e administração'
|
||||
intro: 'Existem limites de uso para fluxos de trabalho de {% data variables.product.prodname_actions %}. As taxas de uso são aplicadas a repositórios que vão além da quantidade de minutos grátis e armazenamento de um repositório.'
|
||||
title: 'Usage limits, billing, and administration'
|
||||
intro: 'There are usage limits for {% data variables.product.prodname_actions %} workflows. Usage charges apply to repositories that go beyond the amount of free minutes and storage for a repository.'
|
||||
redirect_from:
|
||||
- /actions/getting-started-with-github-actions/usage-and-billing-information-for-github-actions
|
||||
- /actions/reference/usage-limits-billing-and-administration
|
||||
@@ -11,91 +11,93 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- Billing
|
||||
shortTitle: Cobrança do fluxo de trabalho & limites
|
||||
shortTitle: Workflow billing & limits
|
||||
---
|
||||
|
||||
{% data reusables.actions.enterprise-beta %}
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
{% data reusables.actions.ae-beta %}
|
||||
|
||||
## Sobre a cobrança do {% data variables.product.prodname_actions %}
|
||||
## About billing for {% data variables.product.prodname_actions %}
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
{% data reusables.github-actions.actions-billing %} Para obter mais informações, consulte "[Sobre a cobrança do {% data variables.product.prodname_actions %}](/billing/managing-billing-for-github-actions/about-billing-for-github-actions)".
|
||||
{% data reusables.github-actions.actions-billing %} For more information, see "[About billing for {% data variables.product.prodname_actions %}](/billing/managing-billing-for-github-actions/about-billing-for-github-actions)."
|
||||
{% else %}
|
||||
O uso do GitHub Actions é gratuito para {% data variables.product.prodname_ghe_server %} que usam executores auto-hospedados.
|
||||
GitHub Actions usage is free for {% data variables.product.prodname_ghe_server %}s that use self-hosted runners.
|
||||
{% endif %}
|
||||
|
||||
## Disponibilidade
|
||||
## Availability
|
||||
|
||||
{% data variables.product.prodname_actions %} está disponível em todos os produtos de {% data variables.product.prodname_dotcom %}, mas {% data variables.product.prodname_actions %} não está disponível para repositórios privados pertencentes a contas usando planos legados por repositório. {% data reusables.gated-features.more-info %}
|
||||
{% data variables.product.prodname_actions %} is available on all {% data variables.product.prodname_dotcom %} products, but {% data variables.product.prodname_actions %} is not available for private repositories owned by accounts using legacy per-repository plans. {% data reusables.gated-features.more-info %}
|
||||
|
||||
## Limites de uso
|
||||
## Usage limits
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
Existem alguns limites sobre o uso de {% data variables.product.prodname_actions %} ao usar executores hospedados em {% data variables.product.prodname_dotcom %}. Estes limites estão sujeitos a mudanças.
|
||||
There are some limits on {% data variables.product.prodname_actions %} usage when using {% data variables.product.prodname_dotcom %}-hosted runners. These limits are subject to change.
|
||||
|
||||
{% note %}
|
||||
|
||||
**Nota:** Para executores auto-hospedados, aplicam-se diferentes limites de uso. Para obter mais informações, consulte "[Sobre os executores auto-hospedados](/actions/hosting-your-own-runners/about-self-hosted-runners/#usage-limits)."
|
||||
**Note:** For self-hosted runners, different usage limits apply. For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners/#usage-limits)."
|
||||
|
||||
{% endnote %}
|
||||
|
||||
- **Tempo de execução de tarefas ** - Cada trabalho em um fluxo de trabalho pode ser executado por até 6 horas de tempo de execução. Se um trabalho atingir esse limite, o trabalho será terminado e não será completado.
|
||||
- **Job execution time** - Each job in a workflow can run for up to 6 hours of execution time. If a job reaches this limit, the job is terminated and fails to complete.
|
||||
{% data reusables.github-actions.usage-workflow-run-time %}
|
||||
{% data reusables.github-actions.usage-api-requests %}
|
||||
- **Tarefas correntes** - O número de trabalhos simultâneos que você pode executar em sua conta depende do seu plano GitHub, conforme indicado na tabela a seguir. Se excedido, quaisquer tarefas adicionais serão colocadas na fila.
|
||||
- **Concurrent jobs** - The number of concurrent jobs you can run in your account depends on your GitHub plan, as indicated in the following table. If exceeded, any additional jobs are queued.
|
||||
|
||||
| Plano GitHub | Total de tarefas simultâneas | Máximo de tarefas macOS simultâneas |
|
||||
| ------------ | ---------------------------- | ----------------------------------- |
|
||||
| Grátis | 20 | 5 |
|
||||
| Pro | 40 | 5 |
|
||||
| Equipe | 60 | 5 |
|
||||
| Enterprise | 180 | 50 |
|
||||
- **Matriz de vagas** - {% data reusables.github-actions.usage-matrix-limits %}
|
||||
| GitHub plan | Total concurrent jobs | Maximum concurrent macOS jobs |
|
||||
|---|---|---|
|
||||
| Free | 20 | 5 |
|
||||
| Pro | 40 | 5 |
|
||||
| Team | 60 | 5 |
|
||||
| Enterprise | 180 | 50 |
|
||||
- **Job matrix** - {% data reusables.github-actions.usage-matrix-limits %}
|
||||
{% data reusables.github-actions.usage-workflow-queue-limits %}
|
||||
|
||||
{% else %}
|
||||
Os limites de uso aplicam-se a executores auto-hospedados. Para obter mais informações, consulte "[Sobre os executores auto-hospedados](/actions/hosting-your-own-runners/about-self-hosted-runners/#usage-limits)."
|
||||
Usage limits apply to self-hosted runners. For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners/#usage-limits)."
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
## Política de uso
|
||||
## Usage policy
|
||||
|
||||
Além dos limites de uso, você deve garantir que você usa {% data variables.product.prodname_actions %} nos [Termos de serviço](/free-pro-team@latest/github/site-policy/github-terms-of-service/) do GitHub. Para obter mais informações sobre termos específicos de {% data variables.product.prodname_actions %}, consulte os [Termos adicionais do produto do GitHub](/free-pro-team@latest/github/site-policy/github-additional-product-terms#a-actions-usage).
|
||||
In addition to the usage limits, you must ensure that you use {% data variables.product.prodname_actions %} within the [GitHub Terms of Service](/free-pro-team@latest/github/site-policy/github-terms-of-service/). For more information on {% data variables.product.prodname_actions %}-specific terms, see the [GitHub Additional Product Terms](/free-pro-team@latest/github/site-policy/github-additional-product-terms#a-actions-usage).
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghes > 3.3 or ghae-issue-4757 or ghec %}
|
||||
## Cobrança para fluxos de trabalho reutilizáveis
|
||||
## Billing for reusable workflows
|
||||
|
||||
Se você reutilizar um fluxo de trabalho, a cobrança será sempre associada ao fluxo de trabalho de chamadas. Para obter mais informações, consulte "[Reutilizando fluxos de trabalho](/actions/learn-github-actions/reusing-workflows)".
|
||||
If you reuse a workflow, billing is always associated with the caller workflow. Assignment of {% ifversion fpt or ghes or ghec %}{% data variables.product.prodname_dotcom %}-hosted runners{% endif %}{% ifversion ghae %}{% data variables.actions.hosted_runner %}s{% endif %} is always evaluated using only the caller's context. The caller cannot use {% ifversion fpt or ghes or ghec %}{% data variables.product.prodname_dotcom %}-hosted runners{% endif %}{% ifversion ghae %}{% data variables.actions.hosted_runner %}s{% endif %} from the called repository.
|
||||
|
||||
For more information see, "[Reusing workflows](/actions/learn-github-actions/reusing-workflows)."
|
||||
{% endif %}
|
||||
|
||||
## Artefato e política de retenção de registro
|
||||
## Artifact and log retention policy
|
||||
|
||||
É possível configurar o artefato e o período de retenção de registro para o seu repositório, organização ou conta corporativa.
|
||||
You can configure the artifact and log retention period for your repository, organization, or enterprise account.
|
||||
|
||||
{% data reusables.actions.about-artifact-log-retention %}
|
||||
|
||||
Para obter mais informações, consulte:
|
||||
For more information, see:
|
||||
|
||||
- "[Gerenciar configurações de {% data variables.product.prodname_actions %} para um repositório](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-repository)"
|
||||
- "[Configurar o período de retenção para {% data variables.product.prodname_actions %} para artefatos e registros na sua organização](/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization)"
|
||||
- "[Aplicar políticas para {% data variables.product.prodname_actions %} na sua empresa](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#enforcing-a-policy-for-artifact-and-log-retention-in-your-enterprise)"
|
||||
- "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-repository)"
|
||||
- "[Configuring the retention period for {% data variables.product.prodname_actions %} for artifacts and logs in your organization](/organizations/managing-organization-settings/configuring-the-retention-period-for-github-actions-artifacts-and-logs-in-your-organization)"
|
||||
- "[Enforcing policies for {% data variables.product.prodname_actions %} in your enterprise](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#enforcing-a-policy-for-artifact-and-log-retention-in-your-enterprise)"
|
||||
|
||||
## Desativar ou limitar {% data variables.product.prodname_actions %} para o seu repositório ou organização
|
||||
## Disabling or limiting {% data variables.product.prodname_actions %} for your repository or organization
|
||||
|
||||
{% data reusables.github-actions.disabling-github-actions %}
|
||||
|
||||
Para obter mais informações, consulte:
|
||||
- "[Gerenciar configurações de {% data variables.product.prodname_actions %} para um repositório](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository)"
|
||||
- "[Desabilitar ou limitar {% data variables.product.prodname_actions %} para a sua organização](/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization)"
|
||||
- "[Aplicar políticas para {% data variables.product.prodname_actions %} na sua empresa](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-github-actions-policies-for-your-enterprise#enforcing-a-policy-for-artifact-and-log-retention-in-your-enterprise)"
|
||||
For more information, see:
|
||||
- "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository)"
|
||||
- "[Disabling or limiting {% data variables.product.prodname_actions %} for your organization](/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization)"
|
||||
- "[Enforcing policies for {% data variables.product.prodname_actions %} in your enterprise](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-github-actions-policies-for-your-enterprise#enforcing-a-policy-for-artifact-and-log-retention-in-your-enterprise)"
|
||||
|
||||
## Desabilitar e habilitar fluxos de trabalho
|
||||
## Disabling and enabling workflows
|
||||
|
||||
Você pode habilitar e desabilitar os fluxos de trabalho individuais no seu repositório em {% data variables.product.prodname_dotcom %}.
|
||||
You can enable and disable individual workflows in your repository on {% data variables.product.prodname_dotcom %}.
|
||||
|
||||
{% data reusables.actions.scheduled-workflows-disabled %}
|
||||
|
||||
Para obter mais informações, consulte "[Desabilitar e habilitar um fluxo de trabalho](/actions/managing-workflow-runs/disabling-and-enabling-a-workflow)".
|
||||
For more information, see "[Disabling and enabling a workflow](/actions/managing-workflow-runs/disabling-and-enabling-a-workflow)."
|
||||
|
||||
@@ -226,6 +226,31 @@ For more information, see "[Reusing workflows](/actions/learn-github-actions/reu
|
||||
|
||||
Required if input is defined for the `on.workflow_call` keyword. The value of this parameter is a string specifying the data type of the input. This must be one of: `boolean`, `number`, or `string`.
|
||||
|
||||
## `on.workflow_call.outputs`
|
||||
|
||||
A map of outputs for a called workflow. Called workflow outputs are available to all downstream jobs in the caller workflow. Each output has an identifier, an optional `description,` and a `value.` The `value` must be set to the value of an output from a job within the called workflow.
|
||||
|
||||
In the example below, two outputs are defined for this reusable workflow: `workflow_output1` and `workflow_output2`. These are mapped to outputs called `job_output1` and `job_output2`, both from a job called `my_job`.
|
||||
|
||||
### Example
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
# Map the workflow outputs to job outputs
|
||||
outputs:
|
||||
workflow_output1:
|
||||
description: "The first job output"
|
||||
value: ${{ jobs.my_job.outputs.job_output1 }}
|
||||
workflow_output2:
|
||||
description: "The second job output"
|
||||
value: ${{ jobs.my_job.outputs.job_output2 }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
For information on how to reference a job output, see [`jobs.<job_id>.outputs`](#jobsjob_idoutputs). For more information, see "[Reusing workflows](/actions/learn-github-actions/reusing-workflows)."
|
||||
|
||||
## `on.workflow_call.secrets`
|
||||
|
||||
A map of the secrets that can be used in the called workflow.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Configurando as atualizações de segurança e versão do Dependabot na sua empresa
|
||||
intro: 'Você pode criar executores dedicados para {% data variables.product.product_location %} que {% data variables.product.prodname_dependabot %} usa para criar pull requests a fim de ajudar a proteger e manter as dependências usadas em repositórios da sua empresa.'
|
||||
title: Setting up Dependabot security and version updates on your enterprise
|
||||
intro: 'You can create dedicated runners for {% data variables.product.product_location %} that {% data variables.product.prodname_dependabot %} uses to create pull requests to help secure and maintain the dependencies used in repositories on your enterprise.'
|
||||
allowTitleToDifferFromFilename: true
|
||||
miniTocMaxHeadingLevel: 3
|
||||
versions:
|
||||
@@ -10,51 +10,52 @@ topics:
|
||||
- Security
|
||||
- Dependabot
|
||||
- Dependencies
|
||||
shortTitle: Configurar atualizações do Dependabot
|
||||
shortTitle: Set up Dependabot updates
|
||||
---
|
||||
|
||||
{% data reusables.dependabot.beta-security-and-version-updates %}
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Dica**: Se {% data variables.product.product_location %} usar clustering, você não poderá configurar a segurança de {% data variables.product.prodname_dependabot %} e as atualizações de versão, uma vez que {% data variables.product.prodname_actions %} não é compatível no modo cluster.
|
||||
**Tip**: If {% data variables.product.product_location %} uses clustering, you cannot set up {% data variables.product.prodname_dependabot %} security and version updates as {% data variables.product.prodname_actions %} are not supported in cluster mode.
|
||||
|
||||
{% endtip %}
|
||||
|
||||
## Sobre as atualizações do {% data variables.product.prodname_dependabot %}
|
||||
## About {% data variables.product.prodname_dependabot %} updates
|
||||
|
||||
Ao configurar {% data variables.product.prodname_dependabot %} de segurança e atualizações de versão para {% data variables.product.product_location %}, os usuários podem configurar os repositórios para que suas dependências sejam atualizadas e mantidas seguras automaticamente. Este é um passo importante para ajudar os desenvolvedores a criar e manter o código seguro.
|
||||
When you set up {% data variables.product.prodname_dependabot %} security and version updates for {% data variables.product.product_location %}, users can configure repositories so that their dependencies are updated and kept secure automatically. This is an important step in helping developers create and maintain secure code.
|
||||
|
||||
Os usuários podem configurar {% data variables.product.prodname_dependabot %} para criar pull requests e atualizar as suas dependências usando duas funcionalidades.
|
||||
Users can set up {% data variables.product.prodname_dependabot %} to create pull requests to update their dependencies using two features.
|
||||
|
||||
- **{% data variables.product.prodname_dependabot_version_updates %}**: Os usuários adicionam um arquivo de configuração de {% data variables.product.prodname_dependabot %} ao repositório para habilitar {% data variables.product.prodname_dependabot %} e criar pull requests quando uma nova versão de uma dependência monitorada for lançada. Para obter mais informações, consulte "[Sobre {% data variables.product.prodname_dependabot_version_updates %}](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates)".
|
||||
- **{% data variables.product.prodname_dependabot_security_updates %}**: Os usuários alternam uma configuração de repositório para habilitar {% data variables.product.prodname_dependabot %} para criar pull requests quando {% data variables.product.prodname_dotcom %} detecta uma vulnerabilidade em uma das dependências do gráfico de dependências para o repositório. Para obter mais informações, consulte "[Sobre alertas para dependências vulneráveis](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies)" e[Sobre {% data variables.product.prodname_dependabot_security_updates %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates)".
|
||||
- **{% data variables.product.prodname_dependabot_version_updates %}**: Users add a {% data variables.product.prodname_dependabot %} configuration file to the repository to enable {% data variables.product.prodname_dependabot %} to create pull requests when a new version of a tracked dependency is released. For more information, see "[About {% data variables.product.prodname_dependabot_version_updates %}](/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates)."
|
||||
- **{% data variables.product.prodname_dependabot_security_updates %}**: Users toggle a repository setting to enable {% data variables.product.prodname_dependabot %} to create pull requests when {% data variables.product.prodname_dotcom %} detects a vulnerability in one of the dependencies of the dependency graph for the repository. For more information, see "[About alerts for vulnerable dependencies](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies)" and "[About {% data variables.product.prodname_dependabot_security_updates %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-dependabot-security-updates)."
|
||||
|
||||
## Pré-requisitos para atualizações de {% data variables.product.prodname_dependabot %}
|
||||
## Prerequisites for {% data variables.product.prodname_dependabot %} updates
|
||||
|
||||
Ambos os tipos de atualização de {% data variables.product.prodname_dependabot %} têm os seguintes requisitos.
|
||||
Both types of {% data variables.product.prodname_dependabot %} update have the following requirements.
|
||||
|
||||
- Configure {% data variables.product.product_location %} para usar {% data variables.product.prodname_actions %}. Para obter mais informações, consulte "[Primeiros passos com {% data variables.product.prodname_actions %} para o GitHub Enterprise Server](/admin/github-actions/enabling-github-actions-for-github-enterprise-server/getting-started-with-github-actions-for-github-enterprise-server)."
|
||||
- Configure um ou mais executores auto-hospedados de {% data variables.product.prodname_actions %} para {% data variables.product.prodname_dependabot %}. Para obter mais informações, consulte "[Configurando executores auto-hospedados para atualizações de {% data variables.product.prodname_dependabot %}](#setting-up-self-hosted-runners-for-dependabot-updates)" abaixo.
|
||||
- Configure {% data variables.product.product_location %} to use {% data variables.product.prodname_actions %}. For more information, see "[Getting started with {% data variables.product.prodname_actions %} for GitHub Enterprise Server](/admin/github-actions/enabling-github-actions-for-github-enterprise-server/getting-started-with-github-actions-for-github-enterprise-server)."
|
||||
- Set up one or more {% data variables.product.prodname_actions %} self-hosted runners for {% data variables.product.prodname_dependabot %}. For more information, see "[Setting up self-hosted runners for {% data variables.product.prodname_dependabot %} updates](#setting-up-self-hosted-runners-for-dependabot-updates)" below.
|
||||
|
||||
Além disso, {% data variables.product.prodname_dependabot_security_updates %} depende do gráfico de dependências, dados de vulnerabilidades de {% data variables.product.prodname_github_connect %} e {% data variables.product.prodname_dependabot_alerts %}. Essas funcionalidades devem ser habilitadas em {% data variables.product.product_location %}. Para obter mais informações, consulte[Habilitando o gráfico de dependências e alertas de {% data variables.product.prodname_dependabot %} na sua conta corporativa](/admin/configuration/managing-connections-between-your-enterprise-accounts/enabling-the-dependency-graph-and-dependabot-alerts-on-your-enterprise-account). "
|
||||
Additionally, {% data variables.product.prodname_dependabot_security_updates %} rely on the dependency graph, vulnerability data from {% data variables.product.prodname_github_connect %}, and {% data variables.product.prodname_dependabot_alerts %}. These features must be enabled on {% data variables.product.product_location %}. For more information, see "[Enabling the dependency graph and {% data variables.product.prodname_dependabot %} alerts on your enterprise account](/admin/configuration/managing-connections-between-your-enterprise-accounts/enabling-the-dependency-graph-and-dependabot-alerts-on-your-enterprise-account)."
|
||||
|
||||
## Configurando executores auto-hospedados para atualizações de {% data variables.product.prodname_dependabot %}
|
||||
## Setting up self-hosted runners for {% data variables.product.prodname_dependabot %} updates
|
||||
|
||||
Quando você tiver configurado {% data variables.product.product_location %} para usar {% data variables.product.prodname_actions %}, você deverá adicionar executores auto-hospedados para atualizações de {% data variables.product.prodname_dependabot %}. Para obter mais informações, consulte "[Primeiros passos com {% data variables.product.prodname_actions %} para o GitHub Enterprise Server](/admin/github-actions/enabling-github-actions-for-github-enterprise-server/getting-started-with-github-actions-for-github-enterprise-server)."
|
||||
When you have configured {% data variables.product.product_location %} to use {% data variables.product.prodname_actions %}, you need to add self-hosted runners for {% data variables.product.prodname_dependabot %} updates. For more information, see "[Getting started with {% data variables.product.prodname_actions %} for GitHub Enterprise Server](/admin/github-actions/enabling-github-actions-for-github-enterprise-server/getting-started-with-github-actions-for-github-enterprise-server)."
|
||||
|
||||
### Requisitos do sistema para executores de {% data variables.product.prodname_dependabot %}
|
||||
### System requirements for {% data variables.product.prodname_dependabot %} runners
|
||||
|
||||
Qualquer VM que você usar para executores de {% data variables.product.prodname_dependabot %} deve atender aos requisitos para executores auto-hospedados. Além disso, eles têm de cumprir os seguintes requisitos.
|
||||
Any VM that you use for {% data variables.product.prodname_dependabot %} runners must meet the requirements for self-hosted runners. In addition, they must meet the following requirements.
|
||||
|
||||
- Sistema operacional Linux
|
||||
- As seguintes dependências instaladas:
|
||||
- Docker em execução como o mesmo usuário que o aplicativo do executor auto-hospedado
|
||||
- Git
|
||||
- Linux operating system
|
||||
- Git installed
|
||||
- Docker installed with access for the runner users:
|
||||
- We recommend installing Docker in rootless mode and configuring the runners to access Docker without `root` privileges.
|
||||
- Alternatively, install Docker and give the runner users raised privileges to run Docker.
|
||||
|
||||
Os requisitos de CPU e memória dependerão do número de executores simultâneos que você implanta em uma determinada VM. Como orientação, criamos de forma bem-sucedida 20 executores em uma única máquina CPU de 8 GB, mas, em última análise, seus requisitos de CPU e memória dependerão fortemente da atualização dos repositórios. Alguns ecossistemas exigirão mais recursos do que outros.
|
||||
The CPU and memory requirements will depend on the number of concurrent runners you deploy on a given VM. As guidance, we have successfully set up 20 runners on a single 2 CPU 8GB machine, but ultimately, your CPU and memory requirements will heavily depend on the repositories being updated. Some ecosystems will require more resources than others.
|
||||
|
||||
Se você especificar mais de 14 runners simultâneos em uma VM, você também deve atualizar o a configuração do Docker `/etc/docker/daemon.json` para aumentar o número padrão de redes que o Docker pode criar.
|
||||
If you specify more than 14 concurrent runners on a VM, you must also update the Docker `/etc/docker/daemon.json` configuration to increase the default number of networks Docker can create.
|
||||
|
||||
```
|
||||
{
|
||||
@@ -64,14 +65,23 @@ Se você especificar mais de 14 runners simultâneos em uma VM, você também de
|
||||
}
|
||||
```
|
||||
|
||||
### Requisitos da rede para executores de {% data variables.product.prodname_dependabot %}
|
||||
### Network requirements for {% data variables.product.prodname_dependabot %} runners
|
||||
|
||||
Os executores de {% data variables.product.prodname_dependabot %} exigem acesso à internet pública, {% data variables.product.prodname_dotcom_the_website %} e a todos os registros internos que serão usados nas atualizações de {% data variables.product.prodname_dependabot %}. Para minimizar o risco para sua rede interna, você deve limitar o acesso da Máquina Virtual (VM) à sua rede interna. Isto reduz o potencial de danos nos sistemas internos se um executor fizer o download de uma dependência capturada.
|
||||
{% data variables.product.prodname_dependabot %} runners require access to the public internet, {% data variables.product.prodname_dotcom_the_website %}, and any internal registries that will be used in {% data variables.product.prodname_dependabot %} updates. To minimize the risk to your internal network, you should limit access from the Virtual Machine (VM) to your internal network. This reduces the potential for damage to internal systems if a runner were to download a hijacked dependency.
|
||||
|
||||
### Adicionando executores auto-hospedados para atualizações de {% data variables.product.prodname_dependabot %}
|
||||
### Adding self-hosted runners for {% data variables.product.prodname_dependabot %} updates
|
||||
|
||||
1. Provisionamento de executores auto-hospedados no nível da conta do repositório, organização ou empresa. Para obter mais informações, consulte "[Sobre executores auto-hospedados](/actions/hosting-your-own-runners/about-self-hosted-runners)" e "[Adicionar executores auto-hospedados](/actions/hosting-your-own-runners/adding-self-hosted-runners)".
|
||||
1. Provision self-hosted runners, at the repository, organization, or enterprise account level. For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners)" and "[Adding self-hosted runners](/actions/hosting-your-own-runners/adding-self-hosted-runners)."
|
||||
|
||||
2. Verifique se os executores auto-hospedados atendem aos requisitos de {% data variables.product.prodname_dependabot %} antes de atribuir uma etiqueta de `dependabot` para cada executr que você deseja que {% data variables.product.prodname_dependabot %} use. Para obter mais informações, consulte "["Usar etiquetas com executores auto-hospedados](/actions/hosting-your-own-runners/using-labels-with-self-hosted-runners#assigning-a-label-to-a-self-hosted-runner)".
|
||||
2. Set up the self-hosted runners with the requirements described above. For example, on a VM running Ubuntu 20.04 you would:
|
||||
|
||||
3. Opcionalmente, habilite os fluxos de trabalho acionados por {% data variables.product.prodname_dependabot %} para usar permissões além das permissões somente leitura e ter acesso a todos os segredos que estão normalmente disponíveis. Para obter mais informações, consulte "[Solucionar problemas de {% data variables.product.prodname_actions %} para a sua empresa](/admin/github-actions/advanced-configuration-and-troubleshooting/troubleshooting-github-actions-for-your-enterprise#enabling-workflows-triggered-by-dependabot-access-to-dependabot-secrets-and-increased-permissions)."
|
||||
- Verify that Git is installed: `command -v git`
|
||||
- Install Docker and ensure that the runner users have access to Docker. For more information, see the Docker documentation.
|
||||
- [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
|
||||
- Recommended approach: [Run the Docker daemon as a non-root user (Rootless mode)](https://docs.docker.com/engine/security/rootless/)
|
||||
- Alternative approach: [Manage Docker as a non-root user](https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user)
|
||||
- Verify that the runners have access to the public internet and can only access the internal networks that {% data variables.product.prodname_dependabot %} needs.
|
||||
|
||||
3. Assign a `dependabot` label to each runner you want {% data variables.product.prodname_dependabot %} to use. For more information, see "[Using labels with self-hosted runners](/actions/hosting-your-own-runners/using-labels-with-self-hosted-runners#assigning-a-label-to-a-self-hosted-runner)."
|
||||
|
||||
4. Optionally, enable workflows triggered by {% data variables.product.prodname_dependabot %} to use more than read-only permissions and to have access to any secrets that are normally available. For more information, see "[Troubleshooting {% data variables.product.prodname_actions %} for your enterprise](/admin/github-actions/advanced-configuration-and-troubleshooting/troubleshooting-github-actions-for-your-enterprise#enabling-workflows-triggered-by-dependabot-access-to-dependabot-secrets-and-increased-permissions)."
|
||||
|
||||
@@ -22,7 +22,7 @@ Before you introduce {% data variables.product.prodname_actions %} to a large en
|
||||
|
||||
## Governance and compliance
|
||||
|
||||
Your should create a plan to govern your enterprise's use of {% data variables.product.prodname_actions %} and meet your compliance obligations.
|
||||
Your should create a plan to govern your enterprise's use of {% data variables.product.prodname_actions %} and meet your compliance obligations.
|
||||
|
||||
Determine which actions your developers will be allowed to use. {% ifversion ghes %}First, decide whether you'll enable access to actions from outside your instance. {% data reusables.actions.access-actions-on-dotcom %} For more information, see "[About using actions in your enterprise](/admin/github-actions/managing-access-to-actions-from-githubcom/about-using-actions-in-your-enterprise)."
|
||||
|
||||
@@ -55,8 +55,8 @@ You should plan where you'll store your secrets. We recommend storing secrets in
|
||||
In {% data variables.product.prodname_dotcom %}, you can store secrets at the repository or organization level. Secrets at the repository level can be limited to workflows in certain environments, such as production or testing. For more information, see "[Encrypted secrets](/actions/security-guides/encrypted-secrets)."
|
||||
|
||||

|
||||
|
||||
You should consider adding manual approval protection for sensitive environments, so that workflows must be approved before getting access to the environments' secrets. For more information, see "[Using environments for deployments](/actions/deployment/targeting-different-environments/using-environments-for-deployment)."
|
||||
{% ifversion fpt or ghes > 3.0 or ghec or ghae %}
|
||||
You should consider adding manual approval protection for sensitive environments, so that workflows must be approved before getting access to the environments' secrets. For more information, see "[Using environments for deployments](/actions/deployment/targeting-different-environments/using-environments-for-deployment)."{% endif %}
|
||||
|
||||
### Security considerations for third-party actions
|
||||
|
||||
@@ -121,4 +121,4 @@ For more detailed usage data, you{% else %}You{% endif %} can use webhooks to su
|
||||
|
||||
Make a plan for how your enterprise can pass the information from these webhooks into a data archiving system. You can consider using "CEDAR.GitHub.Collector", an open source tool that collects and processes webhook data from {% data variables.product.prodname_dotcom %}. For more information, see the [`Microsoft/CEDAR.GitHub.Collector` repository](https://github.com/microsoft/CEDAR.GitHub.Collector/).
|
||||
|
||||
You should also plan how you'll enable your teams to get the data they need from your archiving system.
|
||||
You should also plan how you'll enable your teams to get the data they need from your archiving system.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Alterar os métodos de entrega da autenticação de dois fatores em dispositivos móveis
|
||||
intro: Você pode alternar entre receber códigos de notificação por meio de uma mensagem de texto ou um aplicativo móvel.
|
||||
title: Changing two-factor authentication delivery methods for your mobile device
|
||||
intro: You can switch between receiving authentication codes through a text message or a mobile application.
|
||||
redirect_from:
|
||||
- /articles/changing-two-factor-authentication-delivery-methods/
|
||||
- /articles/changing-two-factor-authentication-delivery-methods-for-your-mobile-device
|
||||
@@ -11,24 +11,25 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- 2FA
|
||||
shortTitle: Altere método de entrega de 2FA
|
||||
shortTitle: Change 2FA delivery method
|
||||
---
|
||||
|
||||
{% note %}
|
||||
|
||||
**Observação:** alterar o método de autenticação de dois fatores invalida a configuração do método atual de dois fatores. No entanto, isso não afeta os códigos de recuperação nem retrocede a configuração de SMS. É possível atualizar os códigos de recuperação ou o retrocesso da configuração de SMS na página de configurações de segurança da sua conta pessoal se desejado.
|
||||
**Note:** Changing your primary method for two-factor authentication invalidates your current two-factor authentication setup, including your recovery codes. Keep your new set of recovery codes safe. Changing your primary method for two-factor authentication does not affect your fallback SMS configuration, if configured. For more information, see "[Configuring two-factor authentication recovery methods](/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication-recovery-methods#setting-a-fallback-authentication-number)."
|
||||
|
||||
{% endnote %}
|
||||
|
||||
{% data reusables.user_settings.access_settings %}
|
||||
{% data reusables.user_settings.security %}
|
||||
3. Ao lado de "SMS delivery" (Entrega de SMS), clique em **Edit** (Editar). 
|
||||
4. Em "Delivery options" (Opções de entrega), clique em **Reconfigure two-factor authentication** (Reconfigurar autenticação de dois fatores). 
|
||||
5. Decida se deseja configurar a autenticação de dois fatores usando um app móvel TOTP ou uma mensagem de texto. Para obter mais informações, consulte "[Configurar a autenticação de dois fatores](/articles/configuring-two-factor-authentication)".
|
||||
- Para configurar a autenticação de dois fatores usando um app móvel TOTP, clique em **Set up using an app** (Configurar usando um app).
|
||||
- Para configurar a autenticação de dois fatores usando mensagem de texto (SMS), clique em **Set up using SMS** (Configurar usando SMS).
|
||||
3. Next to "SMS delivery", click **Edit**.
|
||||

|
||||
4. Under "Delivery options", click **Reconfigure two-factor authentication**.
|
||||

|
||||
5. Decide whether to set up two-factor authentication using a TOTP mobile app or text message. For more information, see "[Configuring two-factor authentication](/articles/configuring-two-factor-authentication)."
|
||||
- To set up two-factor authentication using a TOTP mobile app, click **Set up using an app**.
|
||||
- To set up two-factor authentication using text message (SMS), click **Set up using SMS**.
|
||||
|
||||
## Leia mais
|
||||
## Further reading
|
||||
|
||||
- [Sobre a autenticação de dois fatores](/articles/about-two-factor-authentication)"
|
||||
- "[Configurar métodos de recuperação de autenticação de dois fatores](/articles/configuring-two-factor-authentication-recovery-methods)"
|
||||
- "[About two-factor authentication](/articles/about-two-factor-authentication)"
|
||||
- "[Configuring two-factor authentication recovery methods](/articles/configuring-two-factor-authentication-recovery-methods)"
|
||||
|
||||
@@ -24,8 +24,6 @@ topics:
|
||||
- Repositories
|
||||
---
|
||||
|
||||
<!--For this article in earlier GHES versions, see /content/github/finding-security-vulnerabilities-and-errors-in-your-code-->
|
||||
|
||||
{% data reusables.code-scanning.beta %}
|
||||
{% data reusables.code-scanning.enterprise-enable-code-scanning-actions %}
|
||||
|
||||
@@ -35,13 +33,21 @@ Você decide como gerar alertas de {% data variables.product.prodname_code_scann
|
||||
|
||||
{% data reusables.code-scanning.enabling-options %}
|
||||
|
||||
{% ifversion ghae %}
|
||||
## Pré-requisitos
|
||||
|
||||
Before setting up {% data variables.product.prodname_code_scanning %} for a repository, you must ensure that there is at least one self-hosted {% data variables.product.prodname_actions %} runner available to the repository.
|
||||
|
||||
Enterprise owners, organization and repository administrators can add self-hosted runners. Para obter mais informações, consulte "[Sobre executores auto-hospedados](/actions/hosting-your-own-runners/about-self-hosted-runners)" e "[Adicionar executores auto-hospedados](/actions/hosting-your-own-runners/adding-self-hosted-runners)".
|
||||
{% endif %}
|
||||
|
||||
## Configurar {% data variables.product.prodname_code_scanning %} usando ações
|
||||
|
||||
{% ifversion fpt or ghec %}Usando ações para executar {% data variables.product.prodname_code_scanning %} usará minutos. Para obter mais informações, consulte "[Sobre a cobrança do {% data variables.product.prodname_actions %}](/billing/managing-billing-for-github-actions/about-billing-for-github-actions)."{% endif %}
|
||||
|
||||
{% data reusables.repositories.navigate-to-repo %}
|
||||
{% data reusables.repositories.sidebar-security %}
|
||||
3. À direita dos " alertas de {% data variables.product.prodname_code_scanning_capc %}", clique em **Configurar {% data variables.product.prodname_code_scanning %}**. {% ifversion fpt or ghes > 3.0 or ghae-next or ghec %}Se {% data variables.product.prodname_code_scanning %} está faltando, peça ao proprietário da organização ou administrador do repositório para habilitar {% data variables.product.prodname_GH_advanced_security %}. Para mais informações consulte "[Gerenciar as configurações de segurança e análise para a sua organização](/organizations/keeping-your-organization-secure/managing-security-and-analysis-settings-for-your-organization)" ou "[Gerenciar as configurações de segurança e análise para o seu repositório](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository).{% endif %} 
|
||||
1. À direita dos " alertas de {% data variables.product.prodname_code_scanning_capc %}", clique em **Configurar {% data variables.product.prodname_code_scanning %}**. {% ifversion fpt or ghes > 3.0 or ghae-next or ghec %}Se {% data variables.product.prodname_code_scanning %} está faltando, peça ao proprietário da organização ou administrador do repositório para habilitar {% data variables.product.prodname_GH_advanced_security %}. Para mais informações consulte "[Gerenciar as configurações de segurança e análise para a sua organização](/organizations/keeping-your-organization-secure/managing-security-and-analysis-settings-for-your-organization)" ou "[Gerenciar as configurações de segurança e análise para o seu repositório](/github/administering-a-repository/managing-security-and-analysis-settings-for-your-repository).{% endif %} 
|
||||
4. Em "Começar com {% data variables.product.prodname_code_scanning %}", clique em **Configurar este fluxo de trabalho** no {% data variables.product.prodname_codeql_workflow %} ou em um fluxo de trabalho de terceiros. Os fluxos de trabalho são exibidos apenas se forem relevantes para as linguagens de programação detectadas no repositório. O {% data variables.product.prodname_codeql_workflow %} é sempre exibido, mas o botão "Configurar este fluxo de trabalho" só é habilitado se a análise de {% data variables.product.prodname_codeql %} for compatível com as linguagens presentes no repositório.
|
||||
5. Para personalizar como {% data variables.product.prodname_code_scanning %} faz a varredura do seu código, edite o fluxo de trabalho.
|
||||
|
||||
|
||||
@@ -1,51 +1,51 @@
|
||||
---
|
||||
title: Recuperação de desastres para codespaces
|
||||
intro: 'Este artigo descreve a orientação para um cenário de recuperação de desastre, quando uma região inteira sofre uma interrupção devido a um desastre natural de grandes proporções ou interrupção de serviço generalizada.'
|
||||
title: Disaster recovery for Codespaces
|
||||
intro: 'This article describes guidance for a disaster recovery scenario, when a whole region experiences an outage due to major natural disaster or widespread service interruption.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
topics:
|
||||
- Codespaces
|
||||
shortTitle: Recuperação de desastre
|
||||
shortTitle: Disaster recovery
|
||||
---
|
||||
|
||||
Trabalhamos muito para ter a certeza de que {% data variables.product.prodname_codespaces %} esteja sempre disponível para você. No entanto, forças além do nosso controle às vezes impactam o serviço de formas que podem causar interrupções de serviços não planejadas.
|
||||
We work hard to make sure that {% data variables.product.prodname_codespaces %} is always available to you. However, forces beyond our control sometimes impact the service in ways that can cause unplanned service disruptions.
|
||||
|
||||
Embora os cenários de recuperação de desastres sejam raros, recomendamos que vocês se preparem para a possibilidade de haver uma interrupção de toda uma região. Se uma região inteira tiver uma interrupção do serviço, as cópias redundantes dos seus dados ficarão temporariamente indisponíveis.
|
||||
Although disaster recovery scenarios are rare occurrences, we recommend that you prepare for the possibility that there is an outage of an entire region. If an entire region experiences a service disruption, the locally redundant copies of your data would be temporarily unavailable.
|
||||
|
||||
A orientação a seguir fornece opções sobre como lidar com interrupções de serviço para toda a região onde seu codespace estiver implantado.
|
||||
The following guidance provides options on how to handle service disruption to the entire region where your codespace is deployed.
|
||||
|
||||
{% note %}
|
||||
|
||||
**Observação:** Você pode reduzir o potencial impacto das interrupções por todo serviço fazendo push para repositórios remotos com frequência.
|
||||
**Note:** You can reduce the potential impact of service-wide outages by pushing to remote repositories frequently.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
## Opção 1: Crie um novo ritmo de código em outra região
|
||||
## Option 1: Create a new codespace in another region
|
||||
|
||||
No caso de uma interrupção regional, sugerimos que recrie o seu codespace em uma região não afetada para continuar trabalhando. Este novo código terá todas as alterações a partir do seu último push para {% data variables.product.prodname_dotcom %}. Para obter informações sobre a configuração manual de outra região, consulte "[" Definir sua região padrão para os codespaces](/codespaces/managing-your-codespaces/setting-your-default-region-for-codespaces)".
|
||||
In the case of a regional outage, we suggest you recreate your codespace in an unaffected region to continue working. This new codespace will have all of the changes as of your last push to {% data variables.product.prodname_dotcom %}. For information on manually setting another region, see "[Setting your default region for Codespaces](/codespaces/managing-your-codespaces/setting-your-default-region-for-codespaces)."
|
||||
|
||||
Você pode otimizar o tempo de recuperação configurando um `devcontainer.json` no repositório do projeto, que permite que você defina as ferramentas, tempo de execução, estruturas, configurações do editor, extensões e outras configurações necessárias para restaurar o ambiente de desenvolvimento automaticamente. Para obter mais informações, consulte "[Configurar codespaces para o seu projeto](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
You can optimize recovery time by configuring a `devcontainer.json` in the project's repository, which allows you to define the tools, runtimes, frameworks, editor settings, extensions, and other configuration necessary to restore the development environment automatically. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
## Opção 2: Aguardar a recuperação
|
||||
## Option 2: Wait for recovery
|
||||
|
||||
Neste caso, não é necessária nenhuma ação da sua parte. Saiba que estamos trabalhando diligentemente para restaurar a disponibilidade do serviço.
|
||||
In this case, no action on your part is required. Know that we are working diligently to restore service availability.
|
||||
|
||||
Você pode verificar o status do serviço atual no [Painel de Status](https://www.githubstatus.com/).
|
||||
You can check the current service status on the [Status Dashboard](https://www.githubstatus.com/).
|
||||
|
||||
## Opção 3: Clonar o repositório localmente ou editá-lo no navegador
|
||||
## Option 3: Clone the repository locally or edit in the browser
|
||||
|
||||
Embora o {% data variables.product.prodname_codespaces %} forneça o benefício de um ambiente de desenvolvedor pré-configurado, o seu código-fonte deve sempre poder ser acessado por meio do repositório hospedado em {% data variables.product.prodname_dotcom_the_website %}. Na hipótese de uma interrupção de {% data variables.product.prodname_codespaces %}, você ainda pode clonar o repositório localmente ou editar arquivos no editor do navegador de {% data variables.product.company_short %}. Para obter mais informações, consulte "[Editando arquivos](/repositories/working-with-files/managing-files/editing-files)".
|
||||
While {% data variables.product.prodname_codespaces %} provides the benefit of a pre-configured developer environmnent, your source code should always be accessible through the repository hosted on {% data variables.product.prodname_dotcom_the_website %}. In the event of a {% data variables.product.prodname_codespaces %} outage, you can still clone the repository locally or edit files in the {% data variables.product.company_short %} browser editor. For more information, see "[Editing files](/repositories/working-with-files/managing-files/editing-files)."
|
||||
|
||||
Embora esta opção não configure um ambiente de desenvolvimento para você, ela permitirá que você faça alterações no seu código-fonte, conforme necessário, enquanto você aguarda que a interrupção do serviço seja resolvida.
|
||||
While this option does not configure a development environment for you, it will allow you to make changes to your source code as needed while you wait for the service disruption to resolve.
|
||||
|
||||
## Opção 4: Usar contêineres remotos e o Docker para um ambiente contêinerizado local
|
||||
## Option 4: Use Remote-Containers and Docker for a local containerized environment
|
||||
|
||||
Se seu repositório tiver um `devcontainer.json`, considere o uso da [extensão Remote-Containers](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume) no Visual Studio Code para criar e anexar a um contêiner de desenvolvimento local para seu repositório. O tempo de configuração desta opção irá variar dependendo das suas especificações locais e da complexidade da configuração do seu contêiner de desenvolvimento.
|
||||
If your repository has a `devcontainer.json`, consider using the [Remote-Containers extension](https://code.visualstudio.com/docs/remote/containers#_quick-start-open-a-git-repository-or-github-pr-in-an-isolated-container-volume) in Visual Studio Code to build and attach to a local development container for your repository. The setup time for this option will vary depending on your local specifications and the complexity of your dev container setup.
|
||||
|
||||
{% note %}
|
||||
|
||||
**Observação:** Certifique-se de que sua configuração local atende aos [requisitos mínimos](https://code.visualstudio.com/docs/remote/containers#_system-requirements) antes de tentar essa opção.
|
||||
**Note:** Be sure your local setup meets the [minimum requirements](https://code.visualstudio.com/docs/remote/containers#_system-requirements) before attempting this option.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
---
|
||||
title: Changing the machine type for your codespace
|
||||
shortTitle: Change the machine type
|
||||
intro: 'You can change the type of machine that''s running your codespace, so that you''re using resources appropriate for work you''re doing.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
redirect_from:
|
||||
- /codespaces/developing-in-codespaces/changing-the-machine-type-for-your-codespace
|
||||
topics:
|
||||
- Codespaces
|
||||
---
|
||||
|
||||
## About machine types
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** You can only select or change the machine type if you are a member of an organization using {% data variables.product.prodname_codespaces %} and are creating a codespace on a repository owned by that organization.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
{% data reusables.codespaces.codespaces-machine-types %}
|
||||
|
||||
You can choose a machine type either when you create a codespace or you can change the machine type at any time after you've created a codespace.
|
||||
|
||||
For information on choosing a machine type when you create a codespace, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace)."
|
||||
For information on changing the machine type within {% data variables.product.prodname_vscode %}, see "[Using {% data variables.product.prodname_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code#changing-the-machine-type-in-visual-studio-code)."
|
||||
|
||||
## Changing the machine type in {% data variables.product.prodname_dotcom %}
|
||||
|
||||
{% data reusables.codespaces.your-codespaces-procedure-step %}
|
||||
|
||||
The current machine type for each of your codespaces is displayed.
|
||||
|
||||

|
||||
|
||||
1. Click the ellipsis (**...**) to the right of the codespace you want to modify.
|
||||
1. Click **Change machine type**.
|
||||
|
||||

|
||||
|
||||
1. Choose the required machine type.
|
||||
|
||||
2. Click **Update codespace**.
|
||||
|
||||
The change will take effect the next time your codespace restarts.
|
||||
|
||||
## Force an immediate update of a currently running codespace
|
||||
|
||||
If you change the machine type of a codespace you are currently using, and you want to apply the changes immediately, you can force the codespace to restart.
|
||||
|
||||
1. At the bottom left of your codespace window, click **{% data variables.product.prodname_codespaces %}**.
|
||||
|
||||

|
||||
|
||||
1. From the options that are displayed at the top of the page select **Codespaces: Stop Current Codespace**.
|
||||
|
||||

|
||||
|
||||
1. After the codespace is stopped, click **Restart codespace**.
|
||||
|
||||

|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Personalizando seu codespace
|
||||
intro: '{% data variables.product.prodname_codespaces %} é um ambiente dedicado a você. É possível configurar seus repositórios com um contêiner de desenvolvimento para definir seu ambiente padrão de codespace e personalizar sua experiência de desenvolvimento por meio de todos os seus códigos com dotfiles e Settings Sync.'
|
||||
title: Customizing your codespace
|
||||
intro: '{% data variables.product.prodname_codespaces %} is a dedicated environment for you. You can configure your repositories with a dev container to define their default Codespaces environment, and personalize your development experience across all of your codespaces with dotfiles and Settings Sync.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -10,8 +10,10 @@ redirect_from:
|
||||
topics:
|
||||
- Codespaces
|
||||
children:
|
||||
- /configuring-codespaces-for-your-project
|
||||
- /personalizing-codespaces-for-your-account
|
||||
- /changing-the-machine-type-for-your-codespace
|
||||
- /setting-your-default-editor-for-codespaces
|
||||
- /setting-your-default-region-for-codespaces
|
||||
- /prebuilding-codespaces-for-your-project
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Codespaces de pré-criação para o seu projeto
|
||||
intro: Você pode configurar o seu projeto para pré-criar um codespace automaticamente cada vez que você fizer push de uma alteração no repositório.
|
||||
title: Prebuilding Codespaces for your project
|
||||
intro: You can configure your project to prebuild a codespace automatically each time you push a change to your repository.
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
@@ -10,17 +10,17 @@ topics:
|
||||
- Set up
|
||||
- Fundamentals
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
shortTitle: Codespace de pré-criação
|
||||
shortTitle: Prebuild Codespaces
|
||||
---
|
||||
|
||||
{% note %}
|
||||
|
||||
**Observação:** Este recurso está atualmente em pré-visualização privada.
|
||||
**Note:** This feature is currently in private preview.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
## Sobre a pré-criação de um codespace
|
||||
## About prebuilding a Codespace
|
||||
|
||||
A pré-construção de seus codespace permite que você seja mais produtivo e acesse o seu codespace mais rapidamente. Isso ocorre porque qualquer código-fonte, extensões de editor, dependências de projetos, comandos, ou configurações já foram baixadas, instaladas e aplicadas antes de começar sua sessão de codificação. Depois de fazer push das alterações no repositório, o {% data variables.product.prodname_codespaces %} gerencia automaticamente a configuração das criações.
|
||||
Prebuilding your codespaces allows you to be more productive and access your codespace faster. This is because any source code, editor extensions, project dependencies, commands, or configurations have already been downloaded, installed, and applied before you begin your coding session. Once you push changes to your repository, {% data variables.product.prodname_codespaces %} automatically handles configuring the builds.
|
||||
|
||||
A capacidade de pré-criar codespace está atualmente em visualização privada. Para obter acesso a este recurso, entre em contato com codespaces@github.com.
|
||||
The ability to prebuild Codespaces is currently in private preview. To get access to this feature, contact codespaces@github.com.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
title: Setting your default editor for Codespaces
|
||||
intro: 'You can set your default editor for {% data variables.product.prodname_codespaces %} in your personal settings page.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
redirect_from:
|
||||
- /codespaces/managing-your-codespaces/setting-your-default-editor-for-codespaces
|
||||
topics:
|
||||
- Codespaces
|
||||
shortTitle: Set the default editor
|
||||
---
|
||||
|
||||
On the settings page, you can set your editor preference so that any newly created codespaces are opened automatically in either {% data variables.product.prodname_vscode %} for Web or the {% data variables.product.prodname_vscode %} desktop application.
|
||||
|
||||
If you want to use {% data variables.product.prodname_vscode %} as your default editor for {% data variables.product.prodname_codespaces %}, you need to install {% data variables.product.prodname_vscode %} and the {% data variables.product.prodname_github_codespaces %} extension for {% data variables.product.prodname_vscode %}. For more information, see the [download page for {% data variables.product.prodname_vscode %}](https://code.visualstudio.com/download/) and the [{% data variables.product.prodname_github_codespaces %} extension on the {% data variables.product.prodname_vscode %} marketplace](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces).
|
||||
|
||||
## Setting your default editor
|
||||
|
||||
{% data reusables.user_settings.access_settings %}
|
||||
{% data reusables.user_settings.codespaces-tab %}
|
||||
1. Under "Editor preference", select the option you want.
|
||||

|
||||
If you choose **{% data variables.product.prodname_vscode %}**, {% data variables.product.prodname_codespaces %} will automatically open in the desktop application when you next create a codespace. You may need to allow access to both your browser and {% data variables.product.prodname_vscode %} for it to open successfully.
|
||||

|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
title: Setting your default region for Codespaces
|
||||
intro: 'You can set your default region in the {% data variables.product.prodname_github_codespaces %} profile settings page to personalize where your data is held.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
redirect_from:
|
||||
- /codespaces/managing-your-codespaces/setting-your-default-region-for-codespaces
|
||||
topics:
|
||||
- Codespaces
|
||||
shortTitle: Set the default region
|
||||
---
|
||||
|
||||
You can manually select the region that your codespaces will be created in, allowing you to meet stringent security and compliance requirements. By default, your region is set automatically, based on your location.
|
||||
|
||||
## Setting your default region
|
||||
|
||||
{% data reusables.user_settings.access_settings %}
|
||||
{% data reusables.user_settings.codespaces-tab %}
|
||||
1. Under "Region", select the setting you want.
|
||||
2. If you chose "Set manually", select your region in the drop-down list.
|
||||

|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Criar um codespace
|
||||
intro: Você pode criar um codespace para uma branch em um repositório para fazer o desenvolvimento on-line.
|
||||
title: Creating a codespace
|
||||
intro: You can create a codespace for a branch in a repository to develop online.
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
permissions: '{% data reusables.codespaces.availability %}'
|
||||
redirect_from:
|
||||
@@ -14,103 +14,105 @@ topics:
|
||||
- Codespaces
|
||||
- Fundamentals
|
||||
- Developer
|
||||
shortTitle: Create a codespace
|
||||
---
|
||||
|
||||
## Sobre a criação do codespace
|
||||
## About codespace creation
|
||||
|
||||
Você pode criar um codespace em {% data variables.product.prodname_dotcom_the_website %}, em {% data variables.product.prodname_vscode %}, ou usando {% data variables.product.prodname_cli %}. {% data reusables.codespaces.codespaces-are-personal %}
|
||||
You can create a codespace on {% data variables.product.prodname_dotcom_the_website %}, in {% data variables.product.prodname_vscode %}, or by using {% data variables.product.prodname_cli %}. {% data reusables.codespaces.codespaces-are-personal %}
|
||||
|
||||
Os codespaces são associados a um branch específico de um repositório e o repositório não pode estar vazio. {% data reusables.codespaces.concurrent-codespace-limit %} Para obter mais informações, consulte "[Excluir um codespace](/github/developing-online-with-codespaces/deleting-a-codespace)".
|
||||
Codespaces are associated with a specific branch of a repository and the repository cannot be empty. {% data reusables.codespaces.concurrent-codespace-limit %} For more information, see "[Deleting a codespace](/github/developing-online-with-codespaces/deleting-a-codespace)."
|
||||
|
||||
|
||||
Ao criar um codespace, várias etapas acontecem para criar e conectar você ao seu ambiente de desenvolvimento:
|
||||
When you create a codespace, a number of steps happen to create and connect you to your development environment:
|
||||
|
||||
- Etapa 1: A VM e o armazenamento são atribuídos ao seu codespace.
|
||||
- Etapa 2: O contêiner é criado e seu repositório é clonado.
|
||||
- Passo 3: Você pode conectar-se ao codespace.
|
||||
- Etapa 4: O codespace continua com a configuração pós-criação.
|
||||
- Step 1: VM and storage are assigned to your codespace.
|
||||
- Step 2: Container is created and your repository is cloned.
|
||||
- Step 3: You can connect to the codespace.
|
||||
- Step 4: Codespace continues with post-creation setup.
|
||||
|
||||
Para obter mais informações sobre o que acontece quando você cria um codespace, consulte "[Aprofundamento](/codespaces/getting-started/deep-dive)".
|
||||
For more information on what happens when you create a codespace, see "[Deep Dive](/codespaces/getting-started/deep-dive)."
|
||||
|
||||
Para obter mais informações sobre o ciclo de vida de um codespace, consulte "[Ciclo de vida dos codespaces](/codespaces/developing-in-codespaces/codespaces-lifecycle)".
|
||||
For more information on the lifecycle of a codespace, see "[Codespaces lifecycle](/codespaces/developing-in-codespaces/codespaces-lifecycle)."
|
||||
|
||||
Se você quiser usar hooks do Git para o seu código, você deverá configurar hooks usando os scritps do ciclo de vida do de [`devcontainer.json` lifecycle scripts](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_lifecycle-scripts), como `postCreateCommand`, durante a etapa 4. Uma vez que o seu contêiner de codespace é criado depois que o repositório é clonado, qualquer [diretório de template do git](https://git-scm.com/docs/git-init#_template_directory) configurado na imagem do contêiner não será aplicado ao seu codespace. Os Hooks devem ser instalados depois que o codespace for criado. Para obter mais informações sobre como usar `postCreateCommand`, consulte a referência [`devcontainer.json` ](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_devcontainerjson-properties) na documentação do Visual Studio Code.
|
||||
If you want to use Git hooks for your codespace, then you should set up hooks using the [`devcontainer.json` lifecycle scripts](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_lifecycle-scripts), such as `postCreateCommand`, during step 4. Since your codespace container is created after the repository is cloned, any [git template directory](https://git-scm.com/docs/git-init#_template_directory) configured in the container image will not apply to your codespace. Hooks must instead be installed after the codespace is created. For more information on using `postCreateCommand`, see the [`devcontainer.json` reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference#_devcontainerjson-properties) in the Visual Studio Code documentation.
|
||||
|
||||
{% data reusables.codespaces.use-visual-studio-features %}
|
||||
|
||||
{% data reusables.codespaces.you-can-see-all-your-codespaces %}
|
||||
|
||||
## Acesso a {% data variables.product.prodname_codespaces %}
|
||||
## Access to {% data variables.product.prodname_codespaces %}
|
||||
|
||||
{% data reusables.codespaces.availability %}
|
||||
|
||||
Quando você tem acesso a {% data variables.product.prodname_codespaces %}, você verá uma aba "Codespace" dentro do menu suspenso ** Código de{% octicon "code" aria-label="The code icon" %} ** ao visualizar um repositório.
|
||||
When you have access to {% data variables.product.prodname_codespaces %}, you'll see a "Codespaces" tab within the **{% octicon "code" aria-label="The code icon" %} Code** drop-down menu when you view a repository.
|
||||
|
||||
Você terá acesso a codespaces nas seguintes condições:
|
||||
You'll have access to codespaces under the following conditions:
|
||||
|
||||
* Você é um integrante de uma organização que habilitou {% data variables.product.prodname_codespaces %} e definiu um limite de gastos.
|
||||
* Um proprietário da organização concedeu a você acesso a {% data variables.product.prodname_codespaces %}.
|
||||
* O repositório pertence à organização que habilitou {% data variables.product.prodname_codespaces %}.
|
||||
* You are a member of an organization that has enabled {% data variables.product.prodname_codespaces %} and set a spending limit.
|
||||
* An organization owner has granted you access to {% data variables.product.prodname_codespaces %}.
|
||||
* The repository is owned by the organization that has enabled {% data variables.product.prodname_codespaces %}.
|
||||
|
||||
{% note %}
|
||||
|
||||
**Observação:** As pessoas que já aderiram ao beta com sua conta pessoal do {% data variables.product.prodname_dotcom %} não perderão acesso a {% data variables.product.prodname_codespaces %}. No entanto, {% data variables.product.prodname_codespaces %} para as pessoas, continuará sendo beta.
|
||||
**Note:** Individuals who have already joined the beta with their personal {% data variables.product.prodname_dotcom %} account will not lose access to {% data variables.product.prodname_codespaces %}, however {% data variables.product.prodname_codespaces %} for individuals will continue to remain in beta.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
Os proprietários da organização podem permitir que todos os integrantes da organização criem codespaces, limitem a criação de códigos aos integrantes selecionados da organização ou desabilitem a criação de codespace. Para obter mais informações sobre como gerenciar o acesso aos codespaces dentro da sua organização, consulte "[Habilitar codespace para usuários da sua organização](/codespaces/managing-codespaces-for-your-organization/enabling-codespaces-for-your-organization#enable-codespaces-for-users-in-your-organization)".
|
||||
Organization owners can allow all members of the organization to create codespaces, limit codespace creation to selected organization members, or disable codespace creation. For more information about managing access to codespaces within your organization, see "[Enable Codespaces for users in your organization](/codespaces/managing-codespaces-for-your-organization/enabling-codespaces-for-your-organization#enable-codespaces-for-users-in-your-organization)."
|
||||
|
||||
Antes de {% data variables.product.prodname_codespaces %} pode ser usado em uma organização, um proprietário ou gerente de cobrança deverá ter um limite de gastos. Para obter mais informações, consulte "[Sobre limites de gastos para codespaces](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces#about-spending-limits-for-codespaces)".
|
||||
Before {% data variables.product.prodname_codespaces %} can be used in an organization, an owner or billing manager must have set a spending limit. For more information, see "[About spending limits for Codespaces](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces#about-spending-limits-for-codespaces)."
|
||||
|
||||
Se você deseja criar um codespace para um repositório pertencente à sua conta pessoal ou outro usuário e você tem permissão para criar repositórios em uma organização que habilitou {% data variables.product.prodname_codespaces %}, você poderá criar uma bifurcação de repositórios pertencentes ao usuário na organização e, em seguida, criar um codespace para a bifurcação.
|
||||
If you would like to create a codespace for a repository owned by your personal account or another user, and you have permission to create repositories in an organization that has enabled {% data variables.product.prodname_codespaces %}, you can fork user-owned repositories to that organization and then create a codespace for the fork.
|
||||
|
||||
## Criar um codespace
|
||||
## Creating a codespace
|
||||
|
||||
{% include tool-switcher %}
|
||||
|
||||
|
||||
{% webui %}
|
||||
|
||||
{% data reusables.repositories.navigate-to-repo %}
|
||||
2. No nome do repositório, use o menu suspenso "Branch", e selecione o branch para o qual você deseja criar um codespace.
|
||||
2. Under the repository name, use the "Branch" drop-down menu, and select the branch you want to create a codespace for.
|
||||
|
||||

|
||||

|
||||
|
||||
3. No nome do repositório, use o menu suspenso **Código de {% octicon "code" aria-label="The code icon" %}** e na aba **Codespaces** de código, clique em {% octicon "plus" aria-label="The plus icon" %} **Novo codespace**.
|
||||
3. Under the repository name, use the **{% octicon "code" aria-label="The code icon" %} Code** drop-down menu, and in the **Codespaces** tab, click {% octicon "plus" aria-label="The plus icon" %} **New codespace**.
|
||||
|
||||

|
||||

|
||||
|
||||
Se você é integrante de uma organização e está criando um codespace em um repositório pertencente a essa organização, você poderá selecionar a opção de um tipo de máquina diferente. Na caixa de diálogo, escolha um tipo de máquina e clique em **Criar codespace**. 
|
||||
If you are a member of an organization and are creating a codespace on a repository owned by that organization, you can select the option of a different machine type. From the dialog, choose a machine type and then click **Create codespace**.
|
||||

|
||||
|
||||
{% endwebui %}
|
||||
|
||||
|
||||
{% vscode %}
|
||||
|
||||
{% data reusables.codespaces.creating-a-codespace-in-vscode %}
|
||||
|
||||
{% endvscode %}
|
||||
|
||||
|
||||
{% cli %}
|
||||
|
||||
{% data reusables.cli.cli-learn-more %}
|
||||
|
||||
Para criar um novo codespace, use o subcomando `gh create`.
|
||||
To create a new codespace, use the `gh codespace create` subcommand.
|
||||
|
||||
```shell
|
||||
gh codespace create
|
||||
```
|
||||
|
||||
Solicita-se que você escolha um repositório, um branch e um tipo de máquina (se mais de um estiver disponível).
|
||||
You are prompted to choose a repository, a branch, and a machine type (if more than one is available).
|
||||
|
||||
Como alternativa, você pode usar sinalizadores para especificar algumas ou todas as opções:
|
||||
Alternatively, you can use flags to specify some or all of the options:
|
||||
|
||||
```shell
|
||||
gh codespace create -r <em>owner</em>/<em>repo</em> -b <em>branch</em> -m <em>machine-type</em>
|
||||
```
|
||||
|
||||
Substitua `proprietário/repositório` pelo identificador do repositório. Substitua `branch` pelo nome do branch ou o hash SHA completo do commit, que você deseja fazer check-out inicialmente no codespace. Se você usar o sinalizador `-r` sem o sinalizador `b`, o codespace será criado a partir do branch padrão.
|
||||
Replace `owner/repo` with the repository identifier. Replace `branch` with the name of the branch, or the full SHA hash of the commit, that you want to be initially checked out in the codespace. If you use the `-r` flag without the `b` flag, the codespace is created from the default branch.
|
||||
|
||||
Substitua `machine-type` por um identificador válido para um tipo de máquina disponível. Os identificadores são strings como: `basicLinux32gb` e `standardLinux32gb`. O tipo de máquina que está disponível depende do repositório, da sua conta de usuário e da sua localização. Se você digitar um tipo de máquina inválido ou indisponível, os tipos disponíveis serão mostrados na mensagem de erro. Se você omitir este sinalizador e mais de um tipo de máquina estiver disponível, será solicitado que você escolha uma na lista.
|
||||
Replace `machine-type` with a valid identifier for an available machine type. Identifiers are strings such as: `basicLinux32gb` and `standardLinux32gb`. The type of machines that are available depends on the repository, your user account, and your location. If you enter an invalid or unavailable machine type, the available types are shown in the error message. If you omit this flag and more than one machine type is available you will be prompted to choose one from a list.
|
||||
|
||||
Para obter mais informações sobre esse comando, consulte [o manual de{% data variables.product.prodname_cli %}](https://cli.github.com/manual/gh_codespace_create).
|
||||
For more information about this command, see [the {% data variables.product.prodname_cli %} manual](https://cli.github.com/manual/gh_codespace_create).
|
||||
|
||||
{% endcli %}
|
||||
|
||||
@@ -13,6 +13,7 @@ topics:
|
||||
- Codespaces
|
||||
- Fundamentals
|
||||
- Developer
|
||||
shortTitle: Delete a codespace
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Desenvolver em um codespace
|
||||
intro: 'Você pode abrir um codespace em {% data variables.product.product_name %} e, em seguida, desenvolver usando os recursos do {% data variables.product.prodname_vscode %}.'
|
||||
title: Developing in a codespace
|
||||
intro: 'You can open a codespace on {% data variables.product.product_name %}, then develop using {% data variables.product.prodname_vscode %}''s features.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
permissions: 'You can develop in codespaces you''ve created for repositories owned by organizations using {% data variables.product.prodname_team %} and {% data variables.product.prodname_ghe_cloud %}.'
|
||||
redirect_from:
|
||||
@@ -14,50 +14,52 @@ topics:
|
||||
- Codespaces
|
||||
- Fundamentals
|
||||
- Developer
|
||||
shortTitle: Develop in a codespace
|
||||
---
|
||||
|
||||
|
||||
|
||||
## Sobre o desenvolvimento com {% data variables.product.prodname_codespaces %}
|
||||
## About development with {% data variables.product.prodname_codespaces %}
|
||||
|
||||
{% data variables.product.prodname_codespaces %} fornece a você a experiência completa de desenvolvimento de {% data variables.product.prodname_vscode %}. {% data reusables.codespaces.use-visual-studio-features %}
|
||||
{% data variables.product.prodname_codespaces %} provides you with the full development experience of {% data variables.product.prodname_vscode %}. {% data reusables.codespaces.use-visual-studio-features %}
|
||||
|
||||
{% data reusables.codespaces.links-to-get-started %}
|
||||
|
||||

|
||||

|
||||
|
||||
1. Barra lateral - Por padrão, esta área mostra os arquivos do seu projeto no Explorador.
|
||||
2. Barra de Atividades - Exibe a visualização e fornece uma maneira de alternar entre elas. Você pode reordenar as Visualizações arrastando e soltando-as.
|
||||
3. Editor - É aqui que você edita seus arquivos. Você pode usar a aba para cada editor para posicioná-lo exatamente onde você precisa.
|
||||
4. Painéis - É aqui que você pode visualizar as informações de saída e depuração, bem como o local padrão para o Terminal integrado.
|
||||
5. Barra de Status - Esta área fornece informações úteis sobre seu codespace e projeto. Por exemplo, o nome da agência, portas configuradas e muito mais.
|
||||
1. Side Bar - By default, this area shows your project files in the Explorer.
|
||||
2. Activity Bar - This displays the Views and provides you with a way to switch between them. You can reorder the Views by dragging and dropping them.
|
||||
3. Editor - This is where you edit your files. You can use the tab for each editor to position it exactly where you need it.
|
||||
4. Panels - This is where you can see output and debug information, as well as the default place for the integrated Terminal.
|
||||
5. Status Bar - This area provides you with useful information about your codespace and project. For example, the branch name, configured ports, and more.
|
||||
|
||||
Para obter mais informações sobre como usar {% data variables.product.prodname_vscode %}, consulte o [Guia da Interface do Usuário](https://code.visualstudio.com/docs/getstarted/userinterface) na documentação de {% data variables.product.prodname_vscode %}
|
||||
For more information on using {% data variables.product.prodname_vscode %}, see the [User Interface guide](https://code.visualstudio.com/docs/getstarted/userinterface) in the {% data variables.product.prodname_vscode %} documentation.
|
||||
|
||||
{% data reusables.codespaces.connect-to-codespace-from-vscode %}
|
||||
|
||||
{% data reusables.codespaces.use-chrome %} Para obter mais informações, consulte "[Solução de problemas de codespaces](/codespaces/troubleshooting/troubleshooting-codespaces-clients)".
|
||||
{% data reusables.codespaces.use-chrome %} For more information, see "[Troubleshooting Codespaces clients](/codespaces/troubleshooting/troubleshooting-codespaces-clients)."
|
||||
|
||||
### Personalizando seu codespace
|
||||
### Personalizing your codespace
|
||||
|
||||
{% data reusables.codespaces.about-personalization %} Para obter mais informações, consulte "[Personalizar {% data variables.product.prodname_codespaces %} para sua conta](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account)".
|
||||
{% data reusables.codespaces.about-personalization %} For more information, see "[Personalizing {% data variables.product.prodname_codespaces %} for your account](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account)."
|
||||
|
||||
{% data reusables.codespaces.apply-devcontainer-changes %} Para obter mais informações, consulte "[Configurar o {% data variables.product.prodname_codespaces %} para o seu projeto](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project#apply-changes-to-your-configuration)".
|
||||
{% data reusables.codespaces.apply-devcontainer-changes %} For more information, see "[Configuring {% data variables.product.prodname_codespaces %} for your project](/github/developing-online-with-codespaces/configuring-codespaces-for-your-project#apply-changes-to-your-configuration)."
|
||||
|
||||
### Executando seu aplicativo a partir de um codespace
|
||||
{% data reusables.codespaces.about-port-forwarding %} Para obter mais informações, consulte "[Encaminhar portas no seu codespace](/github/developing-online-with-codespaces/forwarding-ports-in-your-codespace)".
|
||||
### Running your app from a codespace
|
||||
{% data reusables.codespaces.about-port-forwarding %} For more information, see "[Forwarding ports in your codespace](/github/developing-online-with-codespaces/forwarding-ports-in-your-codespace)."
|
||||
|
||||
### Fazendo commit das suas alterações
|
||||
### Committing your changes
|
||||
|
||||
{% data reusables.codespaces.committing-link-to-procedure %}
|
||||
{% data reusables.codespaces.committing-link-to-procedure %}
|
||||
|
||||
### Usando o {% data variables.product.prodname_vscode_command_palette %}
|
||||
### Using the {% data variables.product.prodname_vscode_command_palette %}
|
||||
|
||||
O {% data variables.product.prodname_vscode_command_palette %} permite que você acesse e gerencie muitas funcionalidades para {% data variables.product.prodname_codespaces %} e {% data variables.product.prodname_vscode %}. Para obter mais informações, consulte "[Usando o {% data variables.product.prodname_vscode_command_palette %} em {% data variables.product.prodname_codespaces %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces)".
|
||||
The {% data variables.product.prodname_vscode_command_palette %} allows you to access and manage many features for {% data variables.product.prodname_codespaces %} and {% data variables.product.prodname_vscode %}. For more information, see "[Using the {% data variables.product.prodname_vscode_command_palette %} in {% data variables.product.prodname_codespaces %}](/codespaces/codespaces-reference/using-the-vs-code-command-palette-in-codespaces)."
|
||||
|
||||
## Acessar um codespace existente
|
||||
## Navigating to an existing codespace
|
||||
|
||||
1. {% data reusables.codespaces.you-can-see-all-your-codespaces %}
|
||||
2. Clique no nome do codespace em que você deseja desenvolver. 
|
||||
2. Click the name of the codespace you want to develop in.
|
||||

|
||||
|
||||
Como alternativa, você pode ver qualquer codespace ativo para um repositório acessando esse repositório e selecionando o **Código de {% octicon "code" aria-label="The code icon" %}**. O menu suspenso exibirá todos os codespaces ativos de um repositório.
|
||||
Alternatively, you can see any active codespaces for a repository by navigating to that repository and selecting **{% octicon "code" aria-label="The code icon" %} Code**. The drop-down menu will display all active codespaces for a repository.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Desenvolver em um codespace
|
||||
intro: 'Crie um codespace para começar a desenvolver seu projeto dentro de um ambiente de nuvem dedicado. Você pode usar portas encaminhadas para executar o seu aplicativo e até mesmo usar codespaces dentro de {% data variables.product.prodname_vscode %}'
|
||||
title: Developing in a codespace
|
||||
intro: 'Create a codespace to get started with developing your project inside a dedicated cloud environment. You can use forwarded ports to run your application and even use codespaces inside {% data variables.product.prodname_vscode %}'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -15,8 +15,7 @@ children:
|
||||
- /using-codespaces-for-pull-requests
|
||||
- /deleting-a-codespace
|
||||
- /forwarding-ports-in-your-codespace
|
||||
- /changing-the-machine-type-for-your-codespace
|
||||
- /using-codespaces-in-visual-studio-code
|
||||
- /using-codespaces-with-github-cli
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Usando controle de origem no seu codespace
|
||||
intro: 'Depois de fazer alterações em um arquivo no seu código, você pode fazer um commit rápido das alterações e fazer push da sua atualização para o repositório remoto.'
|
||||
title: Using source control in your codespace
|
||||
intro: After making changes to a file in your codespace you can quickly commit the changes and push your update to the remote repository.
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -10,68 +10,73 @@ topics:
|
||||
- Codespaces
|
||||
- Fundamentals
|
||||
- Developer
|
||||
shortTitle: controle de origem
|
||||
shortTitle: Source control
|
||||
---
|
||||
|
||||
|
||||
|
||||
## Sobre o controle de origem em {% data variables.product.prodname_codespaces %}
|
||||
## About source control in {% data variables.product.prodname_codespaces %}
|
||||
|
||||
Você pode executar todas as ações do Git necessárias diretamente no seu codespace. Por exemplo, é possível obter alterações do repositório remoto, alternar os branches, criar um novo branch, fazer commit, fazer push e criar um pull request. Você pode usar o terminal integrado dentro do seu codespace para inserir nos comandos do Git, ou você pode clicar em ícones e opções de menu para realizar todas as tarefas mais comuns do Git. Este guia explica como usar a interface gráfica de usuário para controle de origem.
|
||||
You can perform all the Git actions you need directly within your codespace. For example, you can fetch changes from the remote repository, switch branches, create a new branch, commit and push changes, and create a pull request. You can use the integrated terminal within your codespace to enter Git commands, or you can click icons and menu options to complete all the most common Git tasks. This guide explains how to use the graphical user interface for source control.
|
||||
|
||||
O controle de origem em {% data variables.product.prodname_github_codespaces %} usa o mesmo fluxo de trabalho que {% data variables.product.prodname_vscode %}. Para obter mais informações, consulte a documentação {% data variables.product.prodname_vscode %}"[Usando Controle de Versão no Código VS](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)".
|
||||
Source control in {% data variables.product.prodname_github_codespaces %} uses the same workflow as {% data variables.product.prodname_vscode %}. For more information, see the {% data variables.product.prodname_vscode %} documentation "[Using Version Control in VS Code](https://code.visualstudio.com/docs/editor/versioncontrol#_git-support)."
|
||||
|
||||
Um fluxo de trabalho típico para atualizar um arquivo que usa {% data variables.product.prodname_github_codespaces %} seria:
|
||||
A typical workflow for updating a file using {% data variables.product.prodname_github_codespaces %} would be:
|
||||
|
||||
* A partir do branch padrão do seu repositório em {% data variables.product.prodname_dotcom %}, crie um codespace. Consulte "[Criando um codespace](/codespaces/developing-in-codespaces/creating-a-codespace)".
|
||||
* No seu código, crie uma nova agência para trabalhar.
|
||||
* Faça suas alterações e salve-as.
|
||||
* Faça commit da alteração.
|
||||
* Abra um pull request.
|
||||
* From the default branch of your repository on {% data variables.product.prodname_dotcom %}, create a codespace. See "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace)."
|
||||
* In your codespace, create a new branch to work on.
|
||||
* Make your changes and save them.
|
||||
* Commit the change.
|
||||
* Raise a pull request.
|
||||
|
||||
## Criar ou trocar de branches
|
||||
## Creating or switching branches
|
||||
|
||||
{% data reusables.codespaces.create-or-switch-branch %}
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Dica**: Se alguém alterou um arquivo no repositório remoto, no branch para o qual você mudou, você não verá essas alterações até você fazer pull das alterações no seu codespace.
|
||||
**Tip**: If someone has changed a file on the remote repository, in the branch you switched to, you will not see those changes until you pull the changes into your codespace.
|
||||
|
||||
{% endtip %}
|
||||
|
||||
## Fazer pull das alterações do repositório remoto
|
||||
## Pulling changes from the remote repository
|
||||
|
||||
Você pode fazer pull das alterações do repositório remoto para seu codespace a qualquer momento.
|
||||
You can pull changes from the remote repository into your codespace at any time.
|
||||
|
||||
{% data reusables.codespaces.source-control-display-dark %}
|
||||
1. Na parte superior da barra lateral, clique na elipse (**...**). 
|
||||
1. No menu suspenso, clique em **Pull**.
|
||||
1. At the top of the side bar, click the ellipsis (**...**).
|
||||

|
||||
1. In the drop-down menu, click **Pull**.
|
||||
|
||||
Se a configuração do contêiner dev foi alterada desde que você criou o codespace, você pode aplicar as alterações reconstruindo o contêiner para o codespace. Para obter mais informações, consulte "[Configurar codespaces para o seu projeto](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project#applying-changes-to-your-configuration)".
|
||||
If the dev container configuration has been changed since you created the codespace, you can apply the changes by rebuilding the container for the codespace. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project#applying-changes-to-your-configuration)."
|
||||
|
||||
## Configurar o seu codespace para buscar novas alterações automaticamente
|
||||
## Setting your codespace to automatically fetch new changes
|
||||
|
||||
É possível definir seu codespace para obter automaticamente os detalhes de quaisquer novos commits que tenham sido criados no repositório remoto. Isso permite que você veja se sua cópia local do repositório está desatualizada. Nesse caso, você pode optar por fazer pull das novas alterações.
|
||||
You can set your codespace to automatically fetch details of any new commits that have been made to the remote repository. This allows you to see whether your local copy of the repository is out of date, in which case you may choose to pull in the new changes.
|
||||
|
||||
Se a operação de busca detectarem novas alterações no repositório remoto, você verá o número de novos commits na barra de status. Você pode fazer pull das alterações para a sua cópia local.
|
||||
If the fetch operation detects new changes on the remote repository, you'll see the number of new commits in the status bar. You can then pull the changes into your local copy.
|
||||
|
||||
1. Clique no botão **Gerenciar** na parte inferior da barra de atividades. 
|
||||
1. No menu, clique em **Configurações**.
|
||||
1. Na página de configurações, pesquise por: `Autofetch`. 
|
||||
1. Para buscar os detalhes das atualizações para todos os controles remotos registrados no repositório atual, defina **Git: Autofetch** como `todos`. 
|
||||
1. Se você deseja alterar o número de segundos entre cada busca automática, edite o valor de **Git: Período de Autofetch**.
|
||||
1. Click the **Manage** button at the bottom of the Activity Bar.
|
||||

|
||||
1. In the menu, slick **Settings**.
|
||||
1. On the Settings page, search for: `autofetch`.
|
||||

|
||||
1. To fetch details of updates for all remotes registered for the current repository, set **Git: Autofetch** to `all`.
|
||||

|
||||
1. If you want to change the number of seconds between each automatic fetch, edit the value of **Git: Autofetch Period**.
|
||||
|
||||
## Fazendo commit das suas alterações
|
||||
## Committing your changes
|
||||
|
||||
{% data reusables.codespaces.source-control-commit-changes %}
|
||||
{% data reusables.codespaces.source-control-commit-changes %}
|
||||
|
||||
## Abrindo um pull request
|
||||
## Raising a pull request
|
||||
|
||||
{% data reusables.codespaces.source-control-pull-request %}
|
||||
{% data reusables.codespaces.source-control-pull-request %}
|
||||
|
||||
## Fazer push das alterações para o seu repositório remoto
|
||||
## Pushing changes to your remote repository
|
||||
|
||||
Você pode fazer push das alterações que fez. Isso aplica essas alterações ao branch upstream no repositório remoto. Você pode querer fazer isso se ainda não estiver pronto para criar um pull request, ou se você preferir criar um pull request em {% data variables.product.prodname_dotcom %}.
|
||||
You can push the changes you've made. This applies those changes to the upstream branch on the remote repository. You might want to do this if you're not yet ready to create a pull request, or if you prefer to create a pull request on {% data variables.product.prodname_dotcom %}.
|
||||
|
||||
1. Na parte superior da barra lateral, clique na elipse (**...**). 
|
||||
1. No menu suspenso, clique em **Push**.
|
||||
1. At the top of the side bar, click the ellipsis (**...**).
|
||||

|
||||
1. In the drop-down menu, click **Push**.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Habilitando codespaces para a sua organização
|
||||
shortTitle: Habilitando codespaces
|
||||
intro: 'Você pode controlar quais usuários da sua organização podem usar {% data variables.product.prodname_codespaces %}.'
|
||||
title: Enabling Codespaces for your organization
|
||||
shortTitle: Enable Codespaces
|
||||
intro: 'You can control which users in your organization can use {% data variables.product.prodname_codespaces %}.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
permissions: 'To manage user permissions for {% data variables.product.prodname_codespaces %} for an organization, you must be an organization owner.'
|
||||
redirect_from:
|
||||
@@ -17,39 +17,40 @@ topics:
|
||||
---
|
||||
|
||||
|
||||
## Sobre habilitar {% data variables.product.prodname_codespaces %} para a sua organização
|
||||
## About enabling {% data variables.product.prodname_codespaces %} for your organization
|
||||
|
||||
Os proprietários da organização podem controlar quais usuários da sua organização podem criar e usar cdespaces.
|
||||
Organization owners can control which users in your organization can create and use codespaces.
|
||||
|
||||
Para usar codespaces na sua organização, você deve fazer o seguinte:
|
||||
To use codespaces in your organization, you must do the following:
|
||||
|
||||
- Certifique-se de que os usuários tenham [pelo menos acesso de gravação](/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization) nos repositórios onde desejam usar um codespace.
|
||||
- [Habilitar {% data variables.product.prodname_codespaces %} para os usuários da sua organização](#configuring-which-users-in-your-organization-can-use-codespaces). Você pode escolher permitir {% data variables.product.prodname_codespaces %} para usuários selecionados ou apenas para usuários específicos.
|
||||
- [Definir um limite de gastos](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)
|
||||
- Ensure that users have [at least write access](/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization) to the repositories where they want to use a codespace.
|
||||
- [Enable {% data variables.product.prodname_codespaces %} for users in your organization](#configuring-which-users-in-your-organization-can-use-codespaces). You can choose allow {% data variables.product.prodname_codespaces %} for selected users or only for specific users.
|
||||
- [Set a spending limit](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)
|
||||
- Ensure that your organization does not have an IP address allow list enabled. For more information, see "[Managing allowed IP addresses for your organization](/organizations/keeping-your-organization-secure/managing-allowed-ip-addresses-for-your-organization)."
|
||||
|
||||
Por padrão, um codespace só pode acessar o repositório no qual ele foi criado. Se você quiser que os codespaces na sua organização possam acessar outros repositórios da organização que o criador do codespace possa acessar, consulte "[Gerenciar acesso e segurança para {% data variables.product.prodname_codespaces %}](/codespaces/managing-codespaces-for-your-organization/managing-access-and-security-for-your-organizations-codespaces)".
|
||||
By default, a codespace can only access the repository from which it was created. If you want codespaces in your organization to be able to access other organization repositories that the codespace creator can access, see "[Managing access and security for {% data variables.product.prodname_codespaces %}](/codespaces/managing-codespaces-for-your-organization/managing-access-and-security-for-your-organizations-codespaces)."
|
||||
|
||||
## Habilitar {% data variables.product.prodname_codespaces %} para os usuários na sua organização
|
||||
## Enable {% data variables.product.prodname_codespaces %} for users in your organization
|
||||
|
||||
{% data reusables.profile.access_org %}
|
||||
{% data reusables.profile.org_settings %}
|
||||
{% data reusables.organizations.click-codespaces %}
|
||||
1. Em "Permissões de usuário", selecione uma das seguintes opções:
|
||||
1. Under "User permissions", select one of the following options:
|
||||
|
||||
* **Permitir para todos os usuários** para permitir que todos os integrantes da sua organização usem {% data variables.product.prodname_codespaces %}.
|
||||
* **Usuários selecionados** para selecionar integrantes específicos da organização para usar {% data variables.product.prodname_codespaces %}.
|
||||
* **Allow for all users** to allow all your organization members to use {% data variables.product.prodname_codespaces %}.
|
||||
* **Selected users** to select specific organization members to use {% data variables.product.prodname_codespaces %}.
|
||||
|
||||

|
||||

|
||||
|
||||
## Desabilitando {% data variables.product.prodname_codespaces %} para sua organização
|
||||
## Disabling {% data variables.product.prodname_codespaces %} for your organization
|
||||
|
||||
{% data reusables.profile.access_org %}
|
||||
{% data reusables.profile.org_settings %}
|
||||
{% data reusables.organizations.click-codespaces %}
|
||||
1. Em "Permissões de usuário", selecione **Desabilitado**.
|
||||
1. Under "User permissions", select **Disabled**.
|
||||
|
||||
## Definindo um limite de gastos
|
||||
## Setting a spending limit
|
||||
|
||||
{% data reusables.codespaces.codespaces-spending-limit-requirement %}
|
||||
{% data reusables.codespaces.codespaces-spending-limit-requirement %}
|
||||
|
||||
Para obter informações sobre como gerenciar e alterar o limite de gastos da sua conta, consulte "[Gerenciar seu limite de gastos para {% data variables.product.prodname_codespaces %}](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)".
|
||||
For information on managing and changing your account's spending limit, see "[Managing your spending limit for {% data variables.product.prodname_codespaces %}](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Gerenciar a cobrança de codespaces na sua organização
|
||||
shortTitle: Gerenciamento de cobrança para codespaces
|
||||
intro: 'Você pode verificar seu uso de {% data variables.product.prodname_codespaces %} e definir os limites de uso.'
|
||||
title: Managing billing for Codespaces in your organization
|
||||
shortTitle: Manage billing
|
||||
intro: 'You can check your {% data variables.product.prodname_codespaces %} usage and set usage limits.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
permissions: 'To manage billing for Codespaces for an organization, you must be an organization owner or a billing manager.'
|
||||
versions:
|
||||
@@ -13,36 +13,36 @@ topics:
|
||||
- Billing
|
||||
---
|
||||
|
||||
## Visão Geral
|
||||
## Overview
|
||||
|
||||
Para saber mais sobre os preços para {% data variables.product.prodname_codespaces %}, consulte "[Preços de {% data variables.product.prodname_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)".
|
||||
To learn about pricing for {% data variables.product.prodname_codespaces %}, see "[{% data variables.product.prodname_codespaces %} pricing](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)."
|
||||
|
||||
{% data reusables.codespaces.codespaces-billing %}
|
||||
|
||||
- Como proprietário de uma organização ou gerente de cobrança, você pode gerenciar a cobrança de {% data variables.product.prodname_codespaces %} para a sua organização: ["Sobre cobrança para codespaces"](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces)
|
||||
- As an an organization owner or a billing manager you can manage {% data variables.product.prodname_codespaces %} billing for your organization: ["About billing for Codespaces"](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces)
|
||||
|
||||
- Para os usuários, há um guia que explica como a cobrança funciona: ["Entendendo a cobrança para codespace"](/codespaces/codespaces-reference/understanding-billing-for-codespaces)
|
||||
- For users, there is a guide that explains how billing works: ["Understanding billing for Codespaces"](/codespaces/codespaces-reference/understanding-billing-for-codespaces)
|
||||
|
||||
## Limites de uso
|
||||
## Usage limits
|
||||
|
||||
Você pode definir um limite de uso para os codespaces na sua organização ou repositório. Este limite é aplicado ao uso de computação e armazenamento para {% data variables.product.prodname_codespaces %}:
|
||||
You can set a usage limit for the codespaces in your organization or repository. This limit is applied to the compute and storage usage for {% data variables.product.prodname_codespaces %}:
|
||||
|
||||
- **Compute minutes:** Compute usage is calculated by the actual number of minutes used by all {% data variables.product.prodname_codespaces %} instances while they are active. These totals are reported to the billing service daily, and is billed monthly. You can set a spending limit for {% data variables.product.prodname_codespaces %} usage in your organization. For more information, see "[Managing spending limits for Codespaces](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)."
|
||||
|
||||
- **Minutos de cálculo:** Uso do cálculo é feito pelo número real de minutos usados por todas as instâncias de {% data variables.product.prodname_codespaces %} enquanto estão ativas. Estes montantes totais são comunicados diariamente ao serviço de cobrança e são cobrados mensalmente. Você pode definir um limite de gastos para uso de {% data variables.product.prodname_codespaces %} na sua organização. Para obter mais informações, consulte "[Gerenciando limites de gastos para os codespaces](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)".
|
||||
- **Storage usage:** For {% data variables.product.prodname_codespaces %} billing purposes, this includes all storage used by all codespaces in your account. This includes all used by the codespaces, such as cloned repositories, configuration files, and extensions, among others. These totals are reported to the billing service daily, and is billed monthly. At the end of the month, {% data variables.product.prodname_dotcom %} rounds your storage to the nearest MB. To check how many compute minutes and storage GB have been used by {% data variables.product.prodname_codespaces %}, see "[Viewing your Codespaces usage"](/billing/managing-billing-for-github-codespaces/viewing-your-codespaces-usage)."
|
||||
|
||||
- **Uso do armazenamento:** Para fins de cobrança de {% data variables.product.prodname_codespaces %}, isto inclui todo o armazenamento usado por todos os codespaces da sua conta. Isto inclui todos os codespacess usados pelos repositórios clonados, arquivos de configuração e extensões, entre outros. Estes montantes totais são comunicados diariamente ao serviço de cobrança e são cobrados mensalmente. No final do mês, {% data variables.product.prodname_dotcom %} arredonda seu armazenamento para o MB mais próximo. Para verificar quantos minutos de computação e armazenamento em GB foram usados por {% data variables.product.prodname_codespaces %}, consulte "[Visualizando o uso dos seus codespaces"](/billing/managing-billing-for-github-codespaces/viewing-your-codespaces-usage)."
|
||||
## Disabling or limiting {% data variables.product.prodname_codespaces %}
|
||||
|
||||
## Desabilitando ou limitando {% data variables.product.prodname_codespaces %}
|
||||
You can disable the use of {% data variables.product.prodname_codespaces %} in your organization or repository. For more information, see "[Managing repository access for your organization's codespaces](/codespaces/managing-codespaces-for-your-organization/managing-access-and-security-for-your-organizations-codespaces)."
|
||||
|
||||
É possível desabilitar o uso de {% data variables.product.prodname_codespaces %} na sua organização ou repositório. Para obter mais informações, consulte "[Gerenciar acesso ao repositório para os codespaces da sua organização](/codespaces/managing-codespaces-for-your-organization/managing-access-and-security-for-your-organizations-codespaces)".
|
||||
You can also limit the individual users who can use {% data variables.product.prodname_codespaces %}. For more information, see "[Managing user permissions for your organization](/codespaces/managing-codespaces-for-your-organization/managing-user-permissions-for-your-organization)."
|
||||
|
||||
Você também pode limitar os usuários individuais que podem usar {% data variables.product.prodname_codespaces %}. Para obter mais informações, consulte "[Gerenciando permissões de usuário para sua organização](/codespaces/managing-codespaces-for-your-organization/managing-user-permissions-for-your-organization)".
|
||||
## Deleting unused codespaces
|
||||
|
||||
## Excluindo codespaces não utilizados
|
||||
|
||||
Seus usuários podem excluir seus codespaces em https://github.com/codespaces e no Visual Studio Code. Para reduzir o tamanho de um codespace, os usuários podem excluir arquivos manualmente usando o terminal ou no Visual Studio Code.
|
||||
Your users can delete their codespaces in https://github.com/codespaces and from within Visual Studio Code. To reduce the size of a codespace, users can manually delete files using the terminal or from within Visual Studio Code.
|
||||
|
||||
{% note %}
|
||||
|
||||
**Observação:** Somente a pessoa que criou um codespace pode excluí-lo. Atualmente, não há forma de os proprietários da organização excluírem os codespaces criados dentro de sua organização.
|
||||
**Note:** Only the person who created a codespace can delete it. There is currently no way for organization owners to delete codespaces created within their organization.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Gerenciar seus codespaces
|
||||
intro: 'Você pode usar as configurações de {% data variables.product.prodname_github_codespaces %} para gerenciar informações que seu codespace possa precisar.'
|
||||
title: Managing your codespaces
|
||||
intro: 'You can use {% data variables.product.prodname_github_codespaces %} settings to manage information that your codespace might need.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -14,7 +14,5 @@ children:
|
||||
- /managing-repository-access-for-your-codespaces
|
||||
- /reviewing-your-security-logs-for-codespaces
|
||||
- /managing-gpg-verification-for-codespaces
|
||||
- /setting-your-default-editor-for-codespaces
|
||||
- /setting-your-default-region-for-codespaces
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
title: Visão geral do GitHub Codespaces
|
||||
shortTitle: Visão Geral
|
||||
title: GitHub Codespaces overview
|
||||
shortTitle: Overview
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
intro: 'Este guia apresenta {% data variables.product.prodname_codespaces %} e fornece informações sobre como ele funciona e como usá-lo.'
|
||||
intro: 'This guide introduces {% data variables.product.prodname_codespaces %} and provides details on how it works and how to use it.'
|
||||
allowTitleToDifferFromFilename: true
|
||||
redirect_from:
|
||||
- /codespaces/codespaces-reference/about-codespaces
|
||||
@@ -18,26 +18,26 @@ topics:
|
||||
- Codespaces
|
||||
---
|
||||
|
||||
## O que é um codespace?
|
||||
## What is a codespace?
|
||||
|
||||
Um codespace é um ambiente de desenvolvimento hospedado na nuvem. Você pode personalizar o seu projeto para {% data variables.product.prodname_codespaces %}, fazendo commit de [arquivos de configuração](/codespaces/customizing-your-codespace/configuring-codespaces-for-your-project) para o seu repositório (geralmente conhecido como configuração como código), que cria uma configuração de código reproduzível para todos os usuários do seu projeto.
|
||||
A codespace is a development environment that's hosted in the cloud. You can customize your project for {% data variables.product.prodname_codespaces %} by committing [configuration files](/codespaces/customizing-your-codespace/configuring-codespaces-for-your-project) to your repository (often known as Configuration-as-Code), which creates a repeatable codespace configuration for all users of your project.
|
||||
|
||||
{% data variables.product.prodname_codespaces %} é executado em uma série de opções de computação baseadas em VM, hospedadas por {% data variables.product.product_location %}, que você pode configurar a partir de 2 a 32 máquinas centrais. Você pode conectar-se aos seus codespaces a partir do navegador ou localmente usando o {% data variables.product.prodname_vscode %}.
|
||||
{% data variables.product.prodname_codespaces %} run on a variety of VM-based compute options hosted by {% data variables.product.product_location %}, which you can configure from 2 core machines up to 32 core machines. You can connect to your codespaces from the browser or locally using {% data variables.product.prodname_vscode %}.
|
||||
|
||||

|
||||

|
||||
|
||||
## Usando codespaces
|
||||
## Using Codespaces
|
||||
|
||||
Você pode criar um codespace a partir de qualquer branch ou commit no seu repositório e começar a desenvolver usando recursos de computação baseados na nuvem. {% data reusables.codespaces.links-to-get-started %}
|
||||
You can create a codespace from any branch or commit in your repository and begin developing using cloud-based compute resources. {% data reusables.codespaces.links-to-get-started %}
|
||||
|
||||
Para personalizar os tempos de execução e ferramentas no seu codespace, você pode criar uma configuração personalizada para definir um ambiente (ou _contêiner dev_) que seja específico para o seu repositório. Usar um contêiner dev permite que você especifique um ambiente Docker para desenvolvimento com uma ferramenta bem definida de ferramenta e tempo de execução que pode fazer referência a uma imagem, arquivo Docker ou docker-compose. Isso significa que qualquer pessoa que estiver usando o repositório terá as mesmas ferramentas disponíveis ao criar o codespace.
|
||||
To customize the runtimes and tools in your codespace, you can create a custom configuration to define an environment (or _dev container_) that is specific for your repository. Using a dev container allows you to specify a Docker environment for development with a well-defined tool and runtime stack that can reference an image, Dockerfile, or docker-compose. This means that anyone using the repository will have the same tools available to them when they create a codespace.
|
||||
|
||||
Se não definir nenhuma configuração personalizada, o {% data variables.product.prodname_codespaces %} clonará seu repositório em um ambiente com a imagem de codespace padrão que inclui muitas ferramentas, linguagens e ambientes de execução. Para obter mais informações, consulte "[Configurando codespaces para o seu projeto](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
If you don't do any custom configuration, {% data variables.product.prodname_codespaces %} will clone your repository into an environment with the default codespace image that includes many tools, languages, and runtime environments. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
|
||||
Você também pode personalizar aspectos do ambiente do seu codespace usando um repositório público do [dotfiles](https://dotfiles.github.io/tutorials/) e [Sincronização de configurações](https://code.visualstudio.com/docs/editor/settings-sync). A personalização pode incluir preferências de shell, ferramentas adicionais, configurações de editor e extensões de código VS. Para obter mais informações, consulte[Personalizando seu codespace](/codespaces/customizing-your-codespace)".
|
||||
You can also personalize aspects of your codespace environment by using a public [dotfiles](https://dotfiles.github.io/tutorials/) repository and [Settings Sync](https://code.visualstudio.com/docs/editor/settings-sync). Personalization can include shell preferences, additional tools, editor settings, and VS Code extensions. For more information, see "[Customizing your codespace](/codespaces/customizing-your-codespace)".
|
||||
|
||||
## Sobre a cobrança do {% data variables.product.prodname_codespaces %}
|
||||
## About billing for {% data variables.product.prodname_codespaces %}
|
||||
|
||||
Para informações sobre os preços, o armazenamento e o uso para {% data variables.product.prodname_codespaces %}, consulte "[Gerenciando a cobrança para {% data variables.product.prodname_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces)".
|
||||
For information on pricing, storage, and usage for {% data variables.product.prodname_codespaces %}, see "[Managing billing for {% data variables.product.prodname_codespaces %}](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces)."
|
||||
|
||||
{% data reusables.codespaces.codespaces-spending-limit-requirement %} Para informações sobre como as organizações proprietários e gerentes de cobrança podem gerenciar o limite de gastos de {% data variables.product.prodname_codespaces %} para uma organização, consulte "[Gerenciar o seu limite de gastos para {% data variables.product.prodname_codespaces %}](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)".
|
||||
{% data reusables.codespaces.codespaces-spending-limit-requirement %} For information on how organizations owners and billing managers can manage the spending limit for {% data variables.product.prodname_codespaces %} for an organization, see "[Managing your spending limit for {% data variables.product.prodname_codespaces %}](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)."
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
---
|
||||
title: Introduction to dev containers
|
||||
intro: 'You can use a `devcontainer.json` file to define a {% data variables.product.prodname_codespaces %} environment for your repository.'
|
||||
allowTitleToDifferFromFilename: true
|
||||
permissions: People with write permissions to a repository can create or edit the codespace configuration.
|
||||
redirect_from:
|
||||
- /github/developing-online-with-github-codespaces/configuring-github-codespaces-for-your-project
|
||||
- /codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project
|
||||
- /github/developing-online-with-codespaces/configuring-codespaces-for-your-project
|
||||
- /codespaces/customizing-your-codespace/configuring-codespaces-for-your-project
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
type: how_to
|
||||
topics:
|
||||
- Codespaces
|
||||
- Set up
|
||||
- Fundamentals
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
---
|
||||
|
||||
|
||||
|
||||
## About dev containers
|
||||
|
||||
A development container, or dev container, is the environment that {% data variables.product.prodname_codespaces %} uses to provide the tools and runtimes that your project needs for development. If your project does not already have a dev container defined, {% data variables.product.prodname_codespaces %} will use the default configuration, which contains many of the common tools that your team might need for development with your project. For more information, see "[Using the default configuration](#using-the-default-configuration)."
|
||||
|
||||
If you want all users of your project to have a consistent environment that is tailored to your project, you can add a dev container to your repository. You can use a predefined configuration to select a common configuration for various project types with the option to further customize your project or you can create your own custom configuration. For more information, see "[Using a predefined container configuration](#using-a-predefined-container-configuration)" and "[Creating a custom codespace configuration](#creating-a-custom-codespace-configuration)." The option you choose is dependent on the tools, runtimes, dependencies, and workflows that a user might need to be successful with your project.
|
||||
|
||||
{% data variables.product.prodname_codespaces %} allows for customization on a per-project and per-branch basis with a `devcontainer.json` file. This configuration file determines the environment of every new codespace anyone creates for your repository by defining a development container that can include frameworks, tools, extensions, and port forwarding. A Dockerfile can also be used alongside the `devcontainer.json` file in the `.devcontainer` folder to define everything required to create a container image.
|
||||
|
||||
### devcontainer.json
|
||||
|
||||
{% data reusables.codespaces.devcontainer-location %}
|
||||
|
||||
You can use your `devcontainer.json` to set default settings for the entire codespace environment, including the editor, but you can also set editor-specific settings for individual [workspaces](https://code.visualstudio.com/docs/editor/workspaces) in a codespace in a file named `.vscode/settings.json`.
|
||||
|
||||
For information about the settings and properties that you can set in a `devcontainer.json`, see [devcontainer.json reference](https://aka.ms/vscode-remote/devcontainer.json) in the {% data variables.product.prodname_vscode %} documentation.
|
||||
|
||||
### Dockerfile
|
||||
|
||||
A Dockerfile also lives in the `.devcontainer` folder.
|
||||
|
||||
You can add a Dockerfile to your project to define a container image and install software. In the Dockerfile, you can use `FROM` to specify the container image.
|
||||
|
||||
```Dockerfile
|
||||
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-14
|
||||
|
||||
# ** [Optional] Uncomment this section to install additional packages. **
|
||||
# USER root
|
||||
#
|
||||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
||||
#
|
||||
# USER codespace
|
||||
```
|
||||
|
||||
You can use the `RUN` instruction to install any software and `&&` to join commands.
|
||||
|
||||
Reference your Dockerfile in your `devcontainer.json` file by using the `dockerfile` property.
|
||||
|
||||
```json
|
||||
{
|
||||
...
|
||||
"build": { "dockerfile": "Dockerfile" },
|
||||
...
|
||||
}
|
||||
```
|
||||
|
||||
For more information on using a Dockerfile in a dev container, see [Create a development container](https://code.visualstudio.com/docs/remote/create-dev-container#_dockerfile) in the {% data variables.product.prodname_vscode %} documentation.
|
||||
|
||||
## Using the default configuration
|
||||
|
||||
If you don't define a configuration in your repository, {% data variables.product.prodname_dotcom %} creates a codespace with a base Linux image. The base Linux image includes languages and runtimes like Python, Node.js, JavaScript, TypeScript, C++, Java, .NET, PHP, PowerShell, Go, Ruby, and Rust. It also includes other developer tools and utilities like git, GitHub CLI, yarn, openssh, and vim. To see all the languages, runtimes, and tools that are included use the `devcontainer-info content-url` command inside your codespace terminal and follow the url that the command outputs.
|
||||
|
||||
Alternatively, for more information about everything that is included in the base Linux image, see the latest file in the [`microsoft/vscode-dev-containers`](https://github.com/microsoft/vscode-dev-containers/tree/main/containers/codespaces-linux) repository.
|
||||
|
||||
The default configuration is a good option if you're working on a small project that uses the languages and tools that {% data variables.product.prodname_codespaces %} provides.
|
||||
|
||||
|
||||
## Using a predefined container configuration
|
||||
|
||||
Predefined container definitions include a common configuration for a particular project type, and can help you quickly get started with a configuration that already has the appropriate container options, {% data variables.product.prodname_vscode %} settings, and {% data variables.product.prodname_vscode %} extensions that should be installed.
|
||||
|
||||
Using a predefined configuration is a great idea if you need some additional extensibility. You can also start with a predefined configuration and amend it as needed for your project's setup.
|
||||
|
||||
{% data reusables.codespaces.command-palette-container %}
|
||||
1. Click the definition you want to use.
|
||||

|
||||
1. Follow the prompts to customize your definition. For more information on the options to customize your definition, see "[Adding additional features to your `devcontainer.json` file](#adding-additional-features-to-your-devcontainerjson-file)."
|
||||
1. Click **OK**.
|
||||

|
||||
1. To apply the changes, in the bottom right corner of the screen, click **Rebuild now**. For more information about rebuilding your container, see "[Applying changes to your configuration](#applying-changes-to-your-configuration)."
|
||||

|
||||
|
||||
### Adding additional features to your `devcontainer.json` file
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** This feature is in beta and subject to change.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
You can add features to your predefined container configuration to customize which tools are available and extend the functionality of your workspace without creating a custom codespace configuration. For example, you could use a predefined container configuration and add the {% data variables.product.prodname_cli %} as well. You can make these additional features available for your project by adding the features to your `devcontainer.json` file when you set up your container configuration.
|
||||
|
||||
You can add some of the most common features by selecting them when configuring your predefined container. For more information on the available features, see the [script library](https://github.com/microsoft/vscode-dev-containers/tree/main/script-library#scripts) in the `vscode-dev-containers` repository.
|
||||
|
||||

|
||||
|
||||
You can also add or remove features outside of the **Add Development Container Configuration Files** workflow.
|
||||
1. Access the Command Palette (`Shift + Command + P` / `Ctrl + Shift + P`), then start typing "configure". Select **Codespaces: Configure Devcontainer Features**.
|
||||

|
||||
2. Update your feature selections, then click **OK**.
|
||||

|
||||
1. To apply the changes, in the bottom right corner of the screen, click **Rebuild now**. For more information about rebuilding your container, see "[Applying changes to your configuration](#applying-changes-to-your-configuration)."
|
||||

|
||||
|
||||
|
||||
## Creating a custom codespace configuration
|
||||
|
||||
If none of the predefined configurations meet your needs, you can create a custom configuration by adding a `devcontainer.json` file. {% data reusables.codespaces.devcontainer-location %}
|
||||
|
||||
In the file, you can use [supported configuration keys](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) to specify aspects of the codespace's environment, like which {% data variables.product.prodname_vscode %} extensions will be installed.
|
||||
|
||||
{% data reusables.codespaces.vscode-settings-order %}
|
||||
|
||||
You can define default editor settings for {% data variables.product.prodname_vscode %} in two places.
|
||||
|
||||
* Editor settings defined in `.vscode/settings.json` are applied as _Workspace_-scoped settings in the codespace.
|
||||
* Editor settings defined in the `settings` key in `devcontainer.json` are applied as _Remote [Codespaces]_-scoped settings in the codespace.
|
||||
|
||||
After updating the `devcontainer.json` file, you can rebuild the container for your codespace to apply the changes. For more information, see "[Applying changes to your configuration](#applying-changes-to-your-configuration)."
|
||||
|
||||
<!--
|
||||
## Supported codespace configuration keys
|
||||
|
||||
You can use configuration keys supported by {% data variables.product.prodname_codespaces %} in `devcontainer.json`.
|
||||
|
||||
### General settings
|
||||
|
||||
- `name`
|
||||
- `settings`
|
||||
- `extensions`
|
||||
- `forwardPorts`
|
||||
- `postCreateCommand`
|
||||
|
||||
### Docker, Dockerfile, or image settings
|
||||
|
||||
- `image`
|
||||
- `dockerFile`
|
||||
- `context`
|
||||
- `containerEnv`
|
||||
- `remoteEnv`
|
||||
- `containerUser`
|
||||
- `remoteUser`
|
||||
- `mounts`
|
||||
- `runArgs`
|
||||
- `overrideCommand`
|
||||
- `dockerComposeFile`
|
||||
|
||||
For more information about the available settings for `devcontainer.json`, see [devcontainer.json reference](https://aka.ms/vscode-remote/devcontainer.json) in the {% data variables.product.prodname_vscode %} documentation.
|
||||
-->
|
||||
|
||||
## Applying changes to your configuration
|
||||
|
||||
{% data reusables.codespaces.apply-devcontainer-changes %}
|
||||
|
||||
{% data reusables.codespaces.rebuild-command %}
|
||||
1. {% data reusables.codespaces.recovery-mode %} Fix the errors in the configuration.
|
||||

|
||||
- To diagnose the error by reviewing the creation logs, click **View creation log**.
|
||||
- To fix the errors identified in the logs, update your `devcontainer.json` file.
|
||||
- To apply the changes, rebuild your container.
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: 'Configurando seu projeto para {% data variables.product.prodname_codespaces %}'
|
||||
intro: 'Aprenda como dar os primeiros passos com {% data variables.product.prodname_codespaces %}, incluindo a configuração para linguagens específicas.'
|
||||
title: 'Setting up your repository for {% data variables.product.prodname_codespaces %}'
|
||||
allowTitleToDifferFromFilename: true
|
||||
intro: 'Learn how to get started with {% data variables.product.prodname_codespaces %}, including set up and configuration for specific languages.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -8,6 +9,8 @@ versions:
|
||||
redirect_from:
|
||||
- /codespaces/getting-started-with-codespaces
|
||||
children:
|
||||
- /configuring-codespaces-for-your-project
|
||||
- /setting-up-your-project-for-codespaces
|
||||
- /setting-up-your-nodejs-project-for-codespaces
|
||||
- /setting-up-your-dotnet-project-for-codespaces
|
||||
- /setting-up-your-java-project-for-codespaces
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
title: Configurando seu projeto C# (.NET) para os codespaces
|
||||
shortTitle: Configurando seu projeto C# (.NET)
|
||||
title: Setting up your C# (.NET) project for Codespaces
|
||||
shortTitle: Setting up your C# (.NET) project
|
||||
allowTitleToDifferFromFilename: true
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
intro: 'Primeiros passos com o seu projeto C# (.NET) em {% data variables.product.prodname_codespaces %} criando um contêiner de desenvolvimento personalizado.'
|
||||
intro: 'Get started with your C# (.NET) project in {% data variables.product.prodname_codespaces %} by creating a custom dev container.'
|
||||
redirect_from:
|
||||
- /codespaces/getting-started-with-codespaces/getting-started-with-your-dotnet-project
|
||||
versions:
|
||||
@@ -11,131 +11,137 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- Codespaces
|
||||
hasExperimentalAlternative: true
|
||||
hidden: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
## Introdução
|
||||
## Introduction
|
||||
|
||||
Este guia mostra como configurar seu projeto C# (.NET) em {% data variables.product.prodname_codespaces %}. Ele irá apresentar a você um exemplo de abertura de seu projeto em um codespace e adicionar e modificar uma configuração de contêiner de desenvolvimento a partir de um modelo.
|
||||
This guide shows you how to set up your C# (.NET) project in {% data variables.product.prodname_codespaces %}. It will take you through an example of opening your project in a codespace, and adding and modifying a dev container configuration from a template.
|
||||
|
||||
### Pré-requisitos
|
||||
### Prerequisites
|
||||
|
||||
- Você deve ter um projeto C# (.NET) existente em um repositório em {% data variables.product.prodname_dotcom_the_website %}. Se você não tiver um projeto, você poderá tentar este tutorial com o seguinte exemplo: https://github.com/2percentsilk/dotnet-quickstart.
|
||||
- Você precisa ter {% data variables.product.prodname_codespaces %} habilitado para a sua organização.
|
||||
- You should have an existing C# (.NET) project in a repository on {% data variables.product.prodname_dotcom_the_website %}. If you don't have a project, you can try this tutorial with the following example: https://github.com/2percentsilk/dotnet-quickstart.
|
||||
- You must have {% data variables.product.prodname_codespaces %} enabled for your organization.
|
||||
|
||||
## Etapa 1: Abra o seu projeto em um codespace
|
||||
## Step 1: Open your project in a codespace
|
||||
|
||||
1. No nome do repositório, use o menu suspenso **Código de {% octicon "code" aria-label="The code icon" %}** e na aba **Codespaces** de código, clique em {% octicon "plus" aria-label="The plus icon" %} **Novo codespace**.
|
||||
1. Under the repository name, use the **{% octicon "code" aria-label="The code icon" %} Code** drop-down menu, and in the **Codespaces** tab, click {% octicon "plus" aria-label="The plus icon" %} **New codespace**.
|
||||
|
||||

|
||||

|
||||
|
||||
Se você não vir esta opção, significa que {% data variables.product.prodname_codespaces %} não está disponível para o seu projeto. Consulte [Acesso a {% data variables.product.prodname_codespaces %}](/codespaces/developing-in-codespaces/creating-a-codespace#access-to-codespaces) para mais informações.
|
||||
If you don’t see this option, {% data variables.product.prodname_codespaces %} isn't available for your project. See [Access to {% data variables.product.prodname_codespaces %}](/codespaces/developing-in-codespaces/creating-a-codespace#access-to-codespaces) for more information.
|
||||
|
||||
Ao criar um código, seu projeto será criado em uma VM remota dedicada a você. Por padrão, o contêiner para o seu codespace têm várias linguagens e tempos de execução, incluindo .NET. Ele também inclui um conjunto comum de ferramentas, como git, wget, rsync, openssh e nano.
|
||||
When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including .NET. It also includes a common set of tools like git, wget, rsync, openssh, and nano.
|
||||
|
||||
Você pode personalizar o seu codespace ajustando a quantidade de vCPUs e RAM, [adicionando dotfiles para personalizar seu ambiente](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account)ou modificando as ferramentas e scripts instalados.
|
||||
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
|
||||
|
||||
{% data variables.product.prodname_codespaces %} usa um arquivo denominado `devcontainer.json` para armazenar configurações. Ao iniciar, {% data variables.product.prodname_codespaces %} usa o arquivo para instalar quaisquer ferramentas, dependências ou outro conjunto que possa ser necessário para o projeto. Para obter mais informações, consulte "[Configurar codespaces para o seu projeto](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
## Etapa 2: Adicione um contêiner de desenvolvimento ao seu codespace a partir de um modelo
|
||||
## Step 2: Add a dev container to your codespace from a template
|
||||
|
||||
O contêiner de codespaces padrão vem com a versão mais recente do .NET e as ferramentas mais comuns pré-instaladas. No entanto, recomendamos que você configure um contêiner personalizado para que possa personalizar as ferramentas e scripts que são executados como parte da criação do codespace para as necessidades do seu projeto e garantir um ambiente reprodutível para todos os usuários de {% data variables.product.prodname_codespaces %} no seu repositório.
|
||||
The default codespaces container comes with the latest .NET version and common tools preinstalled. However, we encourage you to set up a custom container so you can tailor the tools and scripts that run as part of codespace creation to your project's needs and ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
|
||||
|
||||
Para configurar seu projeto com um contêiner personalizado, você deverá usar um arquivo `devcontainer.json` para definir o ambiente. Em {% data variables.product.prodname_codespaces %}, você pode adicionar isto a partir de um modelo ou você pode criar o seu próprio. Para obter mais informações sobre contêineres de desenvolvimento, consulte "[Configurar codespaces para o seu projeto ](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Introduction to dev containers
|
||||
](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
{% data reusables.codespaces.command-palette-container %}
|
||||
2. Para este exemplo, clique em **C# (.NET)**. Se você precisar de funcionalidades adicionais, você poderá selecionar qualquer contêiner específico para o C# (.NET) ou uma combinação de ferramentas como C# (.NET) e MS SQL. 
|
||||
3. Clique na versão recomendada do .NET. 
|
||||
4. Aceite a opção padrão para adicionar Node.js à sua personalização. 
|
||||
2. For this example, click **C# (.NET)**. If you need additional features you can select any container that’s specific to C# (.NET) or a combination of tools such as C# (.NET) and MS SQL.
|
||||

|
||||
3. Click the recommended version of .NET.
|
||||

|
||||
4. Accept the default option to add Node.js to your customization.
|
||||

|
||||
{% data reusables.codespaces.rebuild-command %}
|
||||
|
||||
### Anatomia do seu contêiner de desenvolvimento
|
||||
### Anatomy of your dev container
|
||||
|
||||
A adição do modelo de contêiner de C# (.NET) adiciona uma pasta de contêiner de desenvolvimento `.devcontainer` à raiz do repositório do seu projeto com os seguintes arquivos:
|
||||
Adding the C# (.NET) dev container template adds a `.devcontainer` folder to the root of your project's repository with the following files:
|
||||
|
||||
- `devcontainer.json`
|
||||
- arquivo Docker
|
||||
- Dockerfile
|
||||
|
||||
O arquivo recém-adicionado `devcontainer.json` define algumas propriedades que são descritas após a amostra.
|
||||
The newly added `devcontainer.json` file defines a few properties that are described after the sample.
|
||||
|
||||
#### devcontainer.json
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "C# (.NET)",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
// Update 'VARIANT' to pick a .NET Core version: 2.1, 3.1, 5.0
|
||||
"VARIANT": "5.0",
|
||||
// Options
|
||||
"INSTALL_NODE": "true",
|
||||
"NODE_VERSION": "lts/*",
|
||||
"INSTALL_AZURE_CLI": "false"
|
||||
}
|
||||
},
|
||||
"name": "C# (.NET)",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
// Update 'VARIANT' to pick a .NET Core version: 2.1, 3.1, 5.0
|
||||
"VARIANT": "5.0",
|
||||
// Options
|
||||
"INSTALL_NODE": "true",
|
||||
"NODE_VERSION": "lts/*",
|
||||
"INSTALL_AZURE_CLI": "false"
|
||||
}
|
||||
},
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-dotnettools.csharp"
|
||||
],
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-dotnettools.csharp"
|
||||
],
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [5000, 5001],
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [5000, 5001],
|
||||
|
||||
// [Optional] To reuse of your local HTTPS dev cert:
|
||||
//
|
||||
// 1. Export it locally using this command:
|
||||
// * Windows PowerShell:
|
||||
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
|
||||
// * macOS/Linux terminal:
|
||||
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
|
||||
//
|
||||
// 2. Uncomment these 'remoteEnv' lines:
|
||||
// "remoteEnv": {
|
||||
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
|
||||
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
|
||||
// },
|
||||
//
|
||||
// 3. Do one of the following depending on your scenario:
|
||||
// * When using GitHub Codespaces and/or Remote - Containers:
|
||||
// 1. Start the container
|
||||
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
|
||||
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
|
||||
//
|
||||
// * If only using Remote - Containers with a local container, uncomment this line instead:
|
||||
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],
|
||||
// [Optional] To reuse of your local HTTPS dev cert:
|
||||
//
|
||||
// 1. Export it locally using this command:
|
||||
// * Windows PowerShell:
|
||||
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
|
||||
// * macOS/Linux terminal:
|
||||
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
|
||||
//
|
||||
// 2. Uncomment these 'remoteEnv' lines:
|
||||
// "remoteEnv": {
|
||||
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
|
||||
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
|
||||
// },
|
||||
//
|
||||
// 3. Do one of the following depending on your scenario:
|
||||
// * When using GitHub Codespaces and/or Remote - Containers:
|
||||
// 1. Start the container
|
||||
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
|
||||
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
|
||||
//
|
||||
// * If only using Remote - Containers with a local container, uncomment this line instead:
|
||||
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "dotnet restore",
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "dotnet restore",
|
||||
|
||||
// Comment out connect as root instead. Mais informações: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "vscode"
|
||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "vscode"
|
||||
}
|
||||
```
|
||||
|
||||
- **Nome** - Você pode dar qualquer nome ao nosso contêiner de desenvolvimento. Este é apenas o padrão.
|
||||
- **Build** - As propriedades de compilação.
|
||||
- **Arquivo Docker** - No objeto de compilação, `arquivo Docker` é uma referência ao arquivo arquivo Docker que também foi adicionado a partir do template.
|
||||
- **Name** - You can name our dev container anything, this is just the default.
|
||||
- **Build** - The build properties.
|
||||
- **Dockerfile** - In the build object, `dockerfile` is a reference to the Dockerfile that was also added from the template.
|
||||
- **Args**
|
||||
- **Variante**: Este arquivo contém apenas um argumento de compilação, que é a versão do .NET Core que queremos usar.
|
||||
- **Configurações** - Estas são as configurações de {% data variables.product.prodname_vscode %}.
|
||||
- **Terminal.integrated.shell.linux** - Embora o bash seja o padrão, você pode usar outros shells do terminal, fazendo a modificação.
|
||||
- **Extensões** - Estas são extensões incluídas por padrão.
|
||||
- **ms-dotnettools.csharp** - A extensão Microsoft C# fornece amplo suporte para o desenvolvimento em C#, incluindo funcionalidades como IntelliSense, links, depuração, navegação de código, formatação de código, refatoração, explorador de variáveis, explorador de testes e muito mais.
|
||||
- **forwardPorts** - Todas as portas listadas aqui serão encaminhadas automaticamente. Para obter mais informações, consulte "[Encaminhando portas no seu codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)".
|
||||
- **postCreateCommand** - Se você quiser executar qualquer coisa depois de parar no seu codespace, isso não estará definido no arquivo Docker como a `Dotnet restore`. Você pode fazer isso aqui.
|
||||
- **remoteUser** - Por padrão, você está executando como usuário do vscode, mas, opcionalmente, você pode definir isso como root.
|
||||
- **Variant**: This file only contains one build argument, which is the .NET Core version that we want to use.
|
||||
- **Settings** - These are {% data variables.product.prodname_vscode %} settings.
|
||||
- **Terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this.
|
||||
- **Extensions** - These are extensions included by default.
|
||||
- **ms-dotnettools.csharp** - The Microsoft C# extension provides rich support for developing in C#, including features such as IntelliSense, linting, debugging, code navigation, code formatting, refactoring, variable explorer, test explorer, and more.
|
||||
- **forwardPorts** - Any ports listed here will be forwarded automatically. For more information, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)."
|
||||
- **postCreateCommand** - If you want to run anything after you land in your codespace that’s not defined in the Dockerfile, like `dotnet restore`, you can do that here.
|
||||
- **remoteUser** - By default, you’re running as the vscode user, but you can optionally set this to root.
|
||||
|
||||
#### arquivo Docker
|
||||
#### Dockerfile
|
||||
|
||||
```bash
|
||||
# [Choice] .NET version: 5.0, 3.1, 2.1
|
||||
@@ -161,58 +167,58 @@ RUN if [ "$INSTALL_AZURE_CLI" = "true" ]; then bash /tmp/library-scripts/azcli-d
|
||||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
||||
```
|
||||
|
||||
Você pode usar o arquivo Docker para adicionar camadas adicionais de contêiner para especificar os pacotes do OS, versões de nó ou pacotes globais que queremos que sejam incluídos no nosso contêiner.
|
||||
You can use the Dockerfile to add additional container layers to specify OS packages, node versions, or global packages we want included in our container.
|
||||
|
||||
## Etapa 3: Modifique seu arquivo devcontainer.json
|
||||
## Step 3: Modify your devcontainer.json file
|
||||
|
||||
Com o seu contêiner de desenvolvimento adicionado e um entendimento básico do que tudo faz, agora você pode fazer alterações para configurá-lo para o seu ambiente. Neste exemplo, você irá adicionar propriedades para instalar extensões e restaurar as dependências do seu projeto quando seu codespace for iniciado.
|
||||
With your dev container added and a basic understanding of what everything does, you can now make changes to configure it for your environment. In this example, you'll add properties to install extensions and restore your project dependencies when your codespace launches.
|
||||
|
||||
1. No Explorador, expanda a pasta `.devcontainer` e selecione o arquivo `devcontainer.json` a partir da árvore para abri-lo.
|
||||
1. In the Explorer, expand the `.devcontainer` folder and select the `devcontainer.json` file from the tree to open it.
|
||||
|
||||

|
||||

|
||||
|
||||
2. Atualize a sua lista de `extensões` no seu arquivo `devcontainer.json` para adicionar algumas extensões úteis ao trabalhar com o seu projeto.
|
||||
2. Update your the `extensions` list in your `devcontainer.json` file to add a few extensions that are useful when working with your project.
|
||||
|
||||
```json{:copy}
|
||||
"extensions": [
|
||||
"ms-dotnettools.csharp",
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
],
|
||||
"ms-dotnettools.csharp",
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
],
|
||||
```
|
||||
|
||||
3. Remova o comentário o `postCreateCommand` para restaurar as dependências como parte do processo de configuração do codespace.
|
||||
3. Uncomment the `postCreateCommand` to restore dependencies as part of the codespace setup process.
|
||||
|
||||
```json{:copy}
|
||||
// Use 'postCreateCommand' para executar os comandos após a criação do contêiner.
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
"postCreateCommand": "dotnet restore",
|
||||
```
|
||||
|
||||
{% data reusables.codespaces.rebuild-command %}
|
||||
|
||||
A reconstrução dentro do seu codespace garante que as suas alterações funcionem conforme o esperado antes de realizar o commit das alterações no repositório. Se algo falhar, você será colocado em um codespace com um contêiner de recuperação que você pode reconstruir para continuar ajustando o seu contêiner.
|
||||
Rebuilding inside your codespace ensures your changes work as expected before you commit the changes to the repository. If something does result in a failure, you’ll be placed in a codespace with a recovery container that you can rebuild from to keep adjusting your container.
|
||||
|
||||
5. Verifique se suas alterações foram aplicadas com sucesso verificando se a extensão "Code Spell Checker" foi instalada.
|
||||
5. Check your changes were successfully applied by verifying the "Code Spell Checker" extension was installed.
|
||||
|
||||

|
||||

|
||||
|
||||
## Etapa 4: Execute o seu aplicativo
|
||||
## Step 4: Run your application
|
||||
|
||||
Na seção anterior, você usou o `postCreateCommand` para instalar um conjunto de pacotes por meio do comando `dotnet restore`. Com nossas dependências agora instaladas, podemos executar nosso aplicativo.
|
||||
In the previous section, you used the `postCreateCommand` to install a set of packages via the `dotnet restore` command. With our dependencies now installed, we can run our application.
|
||||
|
||||
1. Execute seu aplicativo pressionando `F5` ou inserindo `dotnet watch run` no seu terminal.
|
||||
1. Run your application by pressing `F5` or entering `dotnet watch run` in your terminal.
|
||||
|
||||
2. Quando o seu projeto for iniciado, você deverá ver um alerta no canto inferior direito com uma instrução para conectar-se à porta que seu projeto usa.
|
||||
2. When your project starts, you should see a toast in the bottom right corner with a prompt to connect to the port your project uses.
|
||||
|
||||

|
||||

|
||||
|
||||
## Etapa 5: Faça commit das suas alterações
|
||||
## Step 5: Commit your changes
|
||||
|
||||
{% data reusables.codespaces.committing-link-to-procedure %}
|
||||
|
||||
## Próximas etapas
|
||||
## Next steps
|
||||
|
||||
Agora você deve estar pronto para começar a desenvolver seu projeto C# (.NET) em {% data variables.product.prodname_codespaces %}. Aqui estão alguns recursos adicionais para cenários mais avançados.
|
||||
You should now be ready start developing your C# (.NET) project in {% data variables.product.prodname_codespaces %}. Here are some additional resources for more advanced scenarios.
|
||||
|
||||
- [Gerenciar segredos criptografados para {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-encrypted-secrets-for-codespaces)
|
||||
- [Gerenciar a verificação de GPG para {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-gpg-verification-for-codespaces)
|
||||
- [Encaminhar portas no seu código](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)
|
||||
- [Managing encrypted secrets for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-encrypted-secrets-for-codespaces)
|
||||
- [Managing GPG verification for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-gpg-verification-for-codespaces)
|
||||
- [Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Configurando seu projeto Java para Codespaces
|
||||
shortTitle: Configurando com seu projeto Java
|
||||
intro: 'Dê os primeiros passos com o seu projeto Java em {% data variables.product.prodname_codespaces %} criando um contêiner de desenvolvimento personalizado.'
|
||||
title: Setting up your Java project for Codespaces
|
||||
shortTitle: Setting up with your Java project
|
||||
intro: 'Get started with your Java project in {% data variables.product.prodname_codespaces %} by creating a custom dev container.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
redirect_from:
|
||||
- /codespaces/getting-started-with-codespaces/getting-started-with-your-java-project-in-codespaces
|
||||
@@ -10,54 +10,58 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- Codespaces
|
||||
hasExperimentalAlternative: true
|
||||
hidden: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
## Introdução
|
||||
## Introduction
|
||||
|
||||
Este guia mostra como configurar seu projeto Java em {% data variables.product.prodname_codespaces %}. Ele irá apresentar a você um exemplo de abertura de seu projeto em um codespace e adicionar e modificar uma configuração de contêiner de desenvolvimento a partir de um modelo.
|
||||
This guide shows you how to set up your Java project in {% data variables.product.prodname_codespaces %}. It will take you through an example of opening your project in a codespace, and adding and modifying a dev container configuration from a template.
|
||||
|
||||
### Pré-requisitos
|
||||
### Prerequisites
|
||||
|
||||
- Você deve ter um projeto Java existente em um repositório em {% data variables.product.prodname_dotcom_the_website %}. Se você não tiver um projeto, você poderá tentar este tutorial com o seguinte exemplo: https://github.com/microsoft/vscode-remote-try-java
|
||||
- Você precisa ter {% data variables.product.prodname_codespaces %} habilitado para a sua organização.
|
||||
- You should have an existing Java project in a repository on {% data variables.product.prodname_dotcom_the_website %}. If you don't have a project, you can try this tutorial with the following example: https://github.com/microsoft/vscode-remote-try-java
|
||||
- You must have {% data variables.product.prodname_codespaces %} enabled for your organization.
|
||||
|
||||
## Etapa 1: Abra o seu projeto em um codespace
|
||||
## Step 1: Open your project in a codespace
|
||||
|
||||
1. No nome do repositório, use o menu suspenso **Código de {% octicon "code" aria-label="The code icon" %}** e na aba **Codespaces** de código, clique em {% octicon "plus" aria-label="The plus icon" %} **Novo codespace**.
|
||||
1. Under the repository name, use the **{% octicon "code" aria-label="The code icon" %} Code** drop-down menu, and in the **Codespaces** tab, click {% octicon "plus" aria-label="The plus icon" %} **New codespace**.
|
||||
|
||||

|
||||

|
||||
|
||||
Se você não vir esta opção, significa que {% data variables.product.prodname_codespaces %} não está disponível para o seu projeto. Consulte [Acesso a {% data variables.product.prodname_codespaces %}](/codespaces/developing-in-codespaces/creating-a-codespace#access-to-codespaces) para mais informações.
|
||||
If you don’t see this option, {% data variables.product.prodname_codespaces %} isn't available for your project. See [Access to {% data variables.product.prodname_codespaces %}](/codespaces/developing-in-codespaces/creating-a-codespace#access-to-codespaces) for more information.
|
||||
|
||||
Ao criar um código, seu projeto será criado em uma VM remota dedicada a você. Por padrão, o contêiner do seu código possui muitas linguagens e tempos de execução, incluindo Java, nvm, npm e yarn. Ele também inclui um conjunto comum de ferramentas, como git, wget, rsync, openssh e nano.
|
||||
When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including Java, nvm, npm, and yarn. It also includes a common set of tools like git, wget, rsync, openssh, and nano.
|
||||
|
||||
Você pode personalizar o seu codespace ajustando a quantidade de vCPUs e RAM, [adicionando dotfiles para personalizar seu ambiente](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account)ou modificando as ferramentas e scripts instalados.
|
||||
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
|
||||
|
||||
{% data variables.product.prodname_codespaces %} usa um arquivo denominado `devcontainer.json` para armazenar configurações. Ao iniciar, {% data variables.product.prodname_codespaces %} usa o arquivo para instalar quaisquer ferramentas, dependências ou outro conjunto que possa ser necessário para o projeto. Para obter mais informações, consulte "[Configurar codespaces para o seu projeto](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
## Etapa 2: Adicione um contêiner de desenvolvimento ao seu codespace a partir de um modelo
|
||||
## Step 2: Add a dev container to your codespace from a template
|
||||
|
||||
O contêiner de codespaces padrão vem com a versão mais recente do Java, gerenciadores de pacotes (Maven, Gradle) e outras ferramentas comuns pré-instaladas. No entanto, recomendamos que você configure um contêiner personalizado para definir as ferramentas e scripts de que seu projeto precisa. Isso garantirá um ambiente reprodutível para todos os usuários de {% data variables.product.prodname_codespaces %} do seu repositório.
|
||||
The default codespaces container comes with the latest Java version, package managers (Maven, Gradle), and other common tools preinstalled. However, we recommend that you set up a custom container to define the tools and scripts that your project needs. This will ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
|
||||
|
||||
Para configurar seu projeto com um contêiner personalizado, você deverá usar um arquivo `devcontainer.json` para definir o ambiente. Em {% data variables.product.prodname_codespaces %}, você pode adicionar isto a partir de um modelo ou você pode criar o seu próprio. Para obter mais informações sobre contêineres de desenvolvimento, consulte "[Configurar espaços de códigos para o seu projeto](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
{% data reusables.codespaces.command-palette-container %}
|
||||
3. Para este exemplo, clique em **Java**. Na prática, você pode selecionar qualquer contêiner específico para Java ou uma combinação de ferramentas como Java e Azure Functions. 
|
||||
4. Clique na versão recomendada do Java. 
|
||||
3. For this example, click **Java**. In practice, you could select any container that’s specific to Java or a combination of tools such as Java and Azure Functions.
|
||||

|
||||
4. Click the recommended version of Java.
|
||||

|
||||
{% data reusables.codespaces.rebuild-command %}
|
||||
|
||||
### Anatomia do seu contêiner de desenvolvimento
|
||||
### Anatomy of your dev container
|
||||
|
||||
A adição do modelo de contêiner de desenvolvimento Java adiciona uma pasta `.devcontainer` à raiz do repositório do seu projeto com os seguintes arquivos:
|
||||
Adding the Java dev container template adds a `.devcontainer` folder to the root of your project's repository with the following files:
|
||||
|
||||
- `devcontainer.json`
|
||||
- arquivo Docker
|
||||
- Dockerfile
|
||||
|
||||
O arquivo recém-adicionado `devcontainer.json` define algumas propriedades que são descritas após a amostra.
|
||||
The newly added `devcontainer.json` file defines a few properties that are described after the sample.
|
||||
|
||||
#### devcontainer.json
|
||||
|
||||
@@ -65,57 +69,57 @@ O arquivo recém-adicionado `devcontainer.json` define algumas propriedades que
|
||||
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.159.0/containers/java
|
||||
{
|
||||
"name": "Java",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
// Update the VARIANT arg to pick a Java version: 11, 14
|
||||
"VARIANT": "11",
|
||||
// Options
|
||||
"INSTALL_MAVEN": "true",
|
||||
"INSTALL_GRADLE": "false",
|
||||
"INSTALL_NODE": "false",
|
||||
"NODE_VERSION": "lts/*"
|
||||
}
|
||||
},
|
||||
"name": "Java",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"args": {
|
||||
// Update the VARIANT arg to pick a Java version: 11, 14
|
||||
"VARIANT": "11",
|
||||
// Options
|
||||
"INSTALL_MAVEN": "true",
|
||||
"INSTALL_GRADLE": "false",
|
||||
"INSTALL_NODE": "false",
|
||||
"NODE_VERSION": "lts/*"
|
||||
}
|
||||
},
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash",
|
||||
"java.home": "/docker-java-home",
|
||||
"maven.executable.path": "/usr/local/sdkman/candidates/maven/current/bin/mvn"
|
||||
},
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash",
|
||||
"java.home": "/docker-java-home",
|
||||
"maven.executable.path": "/usr/local/sdkman/candidates/maven/current/bin/mvn"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"vscjava.vscode-java-pack"
|
||||
],
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"vscjava.vscode-java-pack"
|
||||
],
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "java -version",
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "java -version",
|
||||
|
||||
// Uncomment to connect as a non-root user. Consulte https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "vscode"
|
||||
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "vscode"
|
||||
}
|
||||
```
|
||||
|
||||
- **Nome** - Você pode dar qualquer nome ao seu contêiner de desenvolvimento. Este é apenas o padrão.
|
||||
- **Build** - As propriedades de compilação.
|
||||
- **Arquivo Docker** - No objeto de compilação, o arquivo Docker é uma referência ao arquivo Docker que também foi adicionado a partir do template.
|
||||
- **Name** - You can name your dev container anything, this is just the default.
|
||||
- **Build** - The build properties.
|
||||
- **Dockerfile** - In the build object, dockerfile is a reference to the Dockerfile that was also added from the template.
|
||||
- **Args**
|
||||
- **Variante**: Este arquivo contém apenas um argumento de compilação, que é a versão de Java que é passada para o arquivo Docker.
|
||||
- **Configurações** - Estas são configurações de {% data variables.product.prodname_vscode %} que você pode definir.
|
||||
- **Terminal.integrated.shell.linux** - Embora o bash seja o padrão, você pode usar outros shells do terminal, fazendo a modificação.
|
||||
- **Extensões** - Estas são extensões incluídas por padrão.
|
||||
- **Vscjava.vscode-java-pack** - O pacote de extensão Java fornece extensões populares para o desenvolvimento do Java para você começar.
|
||||
- **forwardPorts** - Todas as portas listadas aqui serão encaminhadas automaticamente. Para obter mais informações, consulte "[Encaminhando portas no seu codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)".
|
||||
- **postCreateCommand** - Se você quiser executar qualquer coisa depois de chegar ao seu codespace que não está definido no arquivo Docker, você poderá fazer isso aqui.
|
||||
- **remoteUser** - Por padrão, você está executando como usuário do `vscode`, mas, opcionalmente, você pode definir isso como `root`.
|
||||
- **Variant**: This file only contains one build argument, which is the Java version that is passed into the Dockerfile.
|
||||
- **Settings** - These are {% data variables.product.prodname_vscode %} settings that you can set.
|
||||
- **Terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this.
|
||||
- **Extensions** - These are extensions included by default.
|
||||
- **Vscjava.vscode-java-pack** - The Java Extension Pack provides popular extensions for Java development to get you started.
|
||||
- **forwardPorts** - Any ports listed here will be forwarded automatically. For more information, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)."
|
||||
- **postCreateCommand** - If you want to run anything after you land in your codespace that’s not defined in the Dockerfile, you can do that here.
|
||||
- **remoteUser** - By default, you’re running as the `vscode` user, but you can optionally set this to `root`.
|
||||
|
||||
#### arquivo Docker
|
||||
#### Dockerfile
|
||||
|
||||
```bash
|
||||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.159.0/containers/java/.devcontainer/base.Dockerfile
|
||||
@@ -143,48 +147,48 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/shar
|
||||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
||||
```
|
||||
|
||||
Você pode usar o arquivo arquivo Docker para adicionar camadas adicionais de contêiner para especificar os pacotes do sistema operacional, versões do Java ou pacotes globais que queremos que sejam incluídos no nosso arquivo Docker.
|
||||
You can use the Dockerfile to add additional container layers to specify OS packages, Java versions, or global packages we want included in our Dockerfile.
|
||||
|
||||
## Etapa 3: Modifique seu arquivo devcontainer.json
|
||||
## Step 3: Modify your devcontainer.json file
|
||||
|
||||
Com o seu contêiner de desenvolvimento adicionado e um entendimento básico do que tudo faz, agora você pode fazer alterações para configurá-lo para o seu ambiente. Neste exemplo, você irá adicionar propriedades para instalar extensões e dependências do seu projeto quando seu codespace for iniciado.
|
||||
With your dev container added and a basic understanding of what everything does, you can now make changes to configure it for your environment. In this example, you'll add properties to install extensions and your project dependencies when your codespace launches.
|
||||
|
||||
1. No Explorer, selecione o arquivo `devcontainer.json` a partir da árvore para abri-lo. Você pode ter que expandir a pasta `.devcontainer` para vê-la.
|
||||
1. In the Explorer, select the `devcontainer.json` file from the tree to open it. You might have to expand the `.devcontainer` folder to see it.
|
||||
|
||||

|
||||

|
||||
|
||||
2. Adicione as seguintes linhas ao seu arquivo `devcontainer.json` após as `extensões`.
|
||||
2. Add the following lines to your `devcontainer.json` file after `extensions`.
|
||||
|
||||
```json{:copy}
|
||||
"postCreateCommand": "npm install",
|
||||
"forwardPorts": [4000],
|
||||
```
|
||||
|
||||
Para obter mais informações sobre as propriedades `devcontainer.json`, consulte a [referência devcontainer.json](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) na documentação do Visual Studio Code.
|
||||
For more information on `devcontainer.json` properties, see the [devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) on the Visual Studio Code docs.
|
||||
|
||||
{% data reusables.codespaces.rebuild-command %}
|
||||
|
||||
A reconstrução dentro do seu codespace garante que as suas alterações funcionem conforme o esperado antes de realizar o commit das alterações no repositório. Se algo falhar, você será colocado em um codespace com um contêiner de recuperação que você pode reconstruir para continuar ajustando o seu contêiner.
|
||||
Rebuilding inside your codespace ensures your changes work as expected before you commit the changes to the repository. If something does result in a failure, you’ll be placed in a codespace with a recovery container that you can rebuild from to keep adjusting your container.
|
||||
|
||||
|
||||
## Etapa 4: Execute o seu aplicativo
|
||||
## Step 4: Run your application
|
||||
|
||||
Na seção anterior, você usou o `postCreateCommand` para instalar um conjunto de pacotes via npm. Agora você pode usar isso para executar nosso aplicativo com npm.
|
||||
In the previous section, you used the `postCreateCommand` to install a set of packages via npm. You can now use this to run our application with npm.
|
||||
|
||||
1. Execute o seu aplicativo pressionando `F5`.
|
||||
1. Run your application by pressing `F5`.
|
||||
|
||||
2. Quando o seu projeto for iniciado, você deverá ver um alerta no canto inferior direito com uma instrução para conectar-se à porta que seu projeto usa.
|
||||
2. When your project starts, you should see a toast in the bottom right corner with a prompt to connect to the port your project uses.
|
||||
|
||||

|
||||

|
||||
|
||||
## Etapa 5: Faça commit das suas alterações
|
||||
## Step 5: Commit your changes
|
||||
|
||||
{% data reusables.codespaces.committing-link-to-procedure %}
|
||||
|
||||
## Próximas etapas
|
||||
## Next steps
|
||||
|
||||
Agora você deve estar pronto para começar a desenvolver seu projeto Java em {% data variables.product.prodname_codespaces %}. Aqui estão alguns recursos adicionais para cenários mais avançados.
|
||||
You should now be ready start developing your Java project in {% data variables.product.prodname_codespaces %}. Here are some additional resources for more advanced scenarios.
|
||||
|
||||
- [Gerenciar segredos criptografados para {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-encrypted-secrets-for-codespaces)
|
||||
- [Gerenciar a verificação de GPG para {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-gpg-verification-for-codespaces)
|
||||
- [Encaminhar portas no seu código](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)
|
||||
- [Managing encrypted secrets for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-encrypted-secrets-for-codespaces)
|
||||
- [Managing GPG verification for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-gpg-verification-for-codespaces)
|
||||
- [Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Configurando seu projeto Node.js para Codespaces
|
||||
shortTitle: Configurando seu projeto Node.js
|
||||
intro: 'Comece com seu projeto JavaScript, Node.js ou TypeScript em {% data variables.product.prodname_codespaces %} criando um contêiner de desenvolvimento personalizado.'
|
||||
title: Setting up your Node.js project for Codespaces
|
||||
shortTitle: Setting up your Node.js project
|
||||
intro: 'Get started with your JavaScript, Node.js, or TypeScript project in {% data variables.product.prodname_codespaces %} by creating a custom dev container.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -14,53 +14,57 @@ topics:
|
||||
- Developer
|
||||
- Node
|
||||
- JavaScript
|
||||
hasExperimentalAlternative: true
|
||||
hidden: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
## Introdução
|
||||
## Introduction
|
||||
|
||||
Este guia mostra como configurar seu projeto JavaScript, Node.js ou TypeScript em {% data variables.product.prodname_codespaces %}. Ele irá apresentar a você um exemplo de abertura de seu projeto em um codespace e adicionar e modificar uma configuração de contêiner de desenvolvimento a partir de um modelo.
|
||||
This guide shows you how to set up your JavaScript, Node.js, or TypeScript project in {% data variables.product.prodname_codespaces %}. It will take you through an example of opening your project in a codespace, and adding and modifying a dev container configuration from a template.
|
||||
|
||||
### Pré-requisitos
|
||||
### Prerequisites
|
||||
|
||||
- Você deve ter um projeto existente de JavaScript, Node.js ou TypeScript em um repositório em {% data variables.product.prodname_dotcom_the_website %}. Se você não tiver um projeto, você poderá tentar este tutorial com o seguinte exemplo: https://github.com/microsoft/vscode-remote-try-node
|
||||
- Você precisa ter {% data variables.product.prodname_codespaces %} habilitado para a sua organização.
|
||||
- You should have an existing JavaScript, Node.js, or TypeScript project in a repository on {% data variables.product.prodname_dotcom_the_website %}. If you don't have a project, you can try this tutorial with the following example: https://github.com/microsoft/vscode-remote-try-node
|
||||
- You must have {% data variables.product.prodname_codespaces %} enabled for your organization.
|
||||
|
||||
## Etapa 1: Abra o seu projeto em um codespace
|
||||
## Step 1: Open your project in a codespace
|
||||
|
||||
1. No nome do repositório, use o menu suspenso **Código de {% octicon "code" aria-label="The code icon" %}** e na aba **Codespaces** de código, clique em {% octicon "plus" aria-label="The plus icon" %} **Novo codespace**.
|
||||
1. Under the repository name, use the **{% octicon "code" aria-label="The code icon" %} Code** drop-down menu, and in the **Codespaces** tab, click {% octicon "plus" aria-label="The plus icon" %} **New codespace**.
|
||||
|
||||

|
||||

|
||||
|
||||
Se você não vir esta opção, significa que {% data variables.product.prodname_codespaces %} não está disponível para o seu projeto. Consulte [Acesso a {% data variables.product.prodname_codespaces %}](/codespaces/developing-in-codespaces/creating-a-codespace#access-to-codespaces) para mais informações.
|
||||
If you don’t see this option, {% data variables.product.prodname_codespaces %} isn't available for your project. See [Access to {% data variables.product.prodname_codespaces %}](/codespaces/developing-in-codespaces/creating-a-codespace#access-to-codespaces) for more information.
|
||||
|
||||
|
||||
Ao criar um código, seu projeto será criado em uma VM remota dedicada a você. Por padrão, o contêiner para o seu código possui muitas linguagens e tempos de execução, incluindo Node.js, JavaScript, Typescript, nvm, npm e yarn. Ele também inclui um conjunto comum de ferramentas, como git, wget, rsync, openssh e nano.
|
||||
When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including Node.js, JavaScript, Typescript, nvm, npm, and yarn. It also includes a common set of tools like git, wget, rsync, openssh, and nano.
|
||||
|
||||
Você pode personalizar o seu codespace ajustando a quantidade de vCPUs e RAM, [adicionando dotfiles para personalizar seu ambiente](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account)ou modificando as ferramentas e scripts instalados.
|
||||
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
|
||||
|
||||
{% data variables.product.prodname_codespaces %} usa um arquivo denominado `devcontainer.json` para armazenar configurações. Ao iniciar, {% data variables.product.prodname_codespaces %} usa o arquivo para instalar quaisquer ferramentas, dependências ou outro conjunto que possa ser necessário para o projeto. Para obter mais informações, consulte "[Configurar codespaces para o seu projeto](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
## Etapa 2: Adicione um contêiner de desenvolvimento ao seu codespace a partir de um modelo
|
||||
## Step 2: Add a dev container to your codespace from a template
|
||||
|
||||
O contêiner de codespaces padrão será compatível com a execução de projetos de Node.js como [vscode-remote-try-node](https://github.com/microsoft/vscode-remote-try-node) fora da caixa. Ao configurar um contêiner personalizado, você poderá personalizar as ferramentas e scripts que são executados como parte da criação de código e garantir um ambiente reprodutível para todos os usuários de {% data variables.product.prodname_codespaces %} no seu repositório.
|
||||
The default codespaces container will support running Node.js projects like [vscode-remote-try-node](https://github.com/microsoft/vscode-remote-try-node) out of the box. By setting up a custom container you can customize the tools and scripts that run as part of codespace creation and ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
|
||||
|
||||
Para configurar seu projeto com um contêiner personalizado, você deverá usar um arquivo `devcontainer.json` para definir o ambiente. Em {% data variables.product.prodname_codespaces %}, você pode adicionar isto a partir de um modelo ou você pode criar o seu próprio. Para obter mais informações sobre contêineres de desenvolvimento, consulte "[Configurar codespaces para o seu projeto](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
|
||||
{% data reusables.codespaces.command-palette-container %}
|
||||
3. Para este exemplo, clique em **Node.js**. Se você precisar de funcionalidades adicionais, você poderá selecionar qualquer contêiner específico para o Node ou uma combinação de ferramentas como Node e MongoDB. 
|
||||
4. Clique na versão recomendada do Node.js. 
|
||||
3. For this example, click **Node.js**. If you need additional features you can select any container that’s specific to Node or a combination of tools such as Node and MongoDB.
|
||||

|
||||
4. Click the recommended version of Node.js.
|
||||

|
||||
{% data reusables.codespaces.rebuild-command %}
|
||||
|
||||
### Anatomia do seu contêiner de desenvolvimento
|
||||
### Anatomy of your dev container
|
||||
|
||||
A adição do modelo de contêiner de desenvolvimento do Node.js adiciona uma pasta `.devcontainer` à raiz do repositório do seu projeto com os seguintes arquivos:
|
||||
Adding the Node.js dev container template adds a `.devcontainer` folder to the root of your project's repository with the following files:
|
||||
|
||||
- `devcontainer.json`
|
||||
- arquivo Docker
|
||||
- Dockerfile
|
||||
|
||||
O arquivo recém-adicionado `devcontainer.json` define algumas propriedades que são descritas após a amostra.
|
||||
The newly added `devcontainer.json` file defines a few properties that are described after the sample.
|
||||
|
||||
#### devcontainer.json
|
||||
|
||||
@@ -68,48 +72,48 @@ O arquivo recém-adicionado `devcontainer.json` define algumas propriedades que
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.162.0/containers/javascript-node
|
||||
{
|
||||
"name": "Node.js",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
// Update 'VARIANT' to pick a Node version: 10, 12, 14
|
||||
"args": { "VARIANT": "14" }
|
||||
},
|
||||
"name": "Node.js",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
// Update 'VARIANT' to pick a Node version: 10, 12, 14
|
||||
"args": { "VARIANT": "14" }
|
||||
},
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"dbaeumer.vscode-eslint"
|
||||
],
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"dbaeumer.vscode-eslint"
|
||||
],
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "yarn install",
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "yarn install",
|
||||
|
||||
// Comment out connect as root instead. Mais informações: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "node"
|
||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "node"
|
||||
}
|
||||
```
|
||||
|
||||
- **Nome** - Você pode dar qualquer nome ao seu contêiner de desenvolvimento. Este é apenas o padrão.
|
||||
- **Build** - As propriedades de compilação.
|
||||
- **Arquivo Docker** - No objeto de compilação, o arquivo Docker é uma referência ao arquivo Docker que também foi adicionado a partir do modelo.
|
||||
- **Name** - You can name your dev container anything, this is just the default.
|
||||
- **Build** - The build properties.
|
||||
- **dockerfile** - In the build object, dockerfile is a reference to the Dockerfile that was also added from the template.
|
||||
- **Args**
|
||||
- **Variante**: Este arquivo contém apenas um argumento de compilação, que é a variante de nó que queremos usar e que é passada para o arquivo Docker.
|
||||
- **Configurações** - Estas são configurações de {% data variables.product.prodname_vscode %} que você pode definir.
|
||||
- **Terminal.integrated.shell.linux** - Embora o bash seja o padrão, você pode usar outros shells do terminal, fazendo a modificação.
|
||||
- **Extensões** - Estas são extensões incluídas por padrão.
|
||||
- <**Dbaeumer.vscode-eslint** - ES lint é uma ótima extensão para linting, mas para o JavaScript, há uma série de ótimas extensões do Marketplace que você também pode incluir.
|
||||
- **forwardPorts** - Todas as portas listadas aqui serão encaminhadas automaticamente. Para obter mais informações, consulte "[Encaminhando portas no seu codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)".
|
||||
- **postCreateCommand** - Se você quiser executar qualquer coisa depois de chegar ao seu codespace que não está definido no arquivo Docker, você poderá fazer isso aqui.
|
||||
- **remoteUser** - Por padrão, você está executando como usuário do vscode, mas, opcionalmente, você pode definir isso como root.
|
||||
- **Variant**: This file only contains one build argument, which is the node variant we want to use that is passed into the Dockerfile.
|
||||
- **Settings** - These are {% data variables.product.prodname_vscode %} settings that you can set.
|
||||
- **Terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this.
|
||||
- **Extensions** - These are extensions included by default.
|
||||
- **Dbaeumer.vscode-eslint** - ES lint is a great extension for linting, but for JavaScript there are a number of great Marketplace extensions you could also include.
|
||||
- **forwardPorts** - Any ports listed here will be forwarded automatically. For more information, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)."
|
||||
- **postCreateCommand** - If you want to run anything after you land in your codespace that’s not defined in the Dockerfile, you can do that here.
|
||||
- **remoteUser** - By default, you’re running as the vscode user, but you can optionally set this to root.
|
||||
|
||||
#### arquivo Docker
|
||||
#### Dockerfile
|
||||
|
||||
```bash
|
||||
# [Choice] Node.js version: 14, 12, 10
|
||||
@@ -128,50 +132,50 @@ FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}
|
||||
# RUN su node -c "npm install -g <your-package-list-here>"
|
||||
```
|
||||
|
||||
Você pode usar o arquivo Docker para adicionar camadas adicionais de contêiner para especificar os pacotes do sistema operacional, versões de nó ou pacotes globais que queremos que sejam incluídos no nosso arquivo Docker.
|
||||
You can use the Dockerfile to add additional container layers to specify OS packages, node versions, or global packages we want included in our Dockerfile.
|
||||
|
||||
## Etapa 3: Modifique seu arquivo devcontainer.json
|
||||
## Step 3: Modify your devcontainer.json file
|
||||
|
||||
Com o seu contêiner de desenvolvimento adicionado e um entendimento básico do que tudo faz, agora você pode fazer alterações para configurá-lo para o seu ambiente. Neste exemplo, você irá adicionar propriedades para instalar o npm quando seu codespace for lançado e para fazer uma lista de portas dentro do contêiner disponível localmente.
|
||||
With your dev container added and a basic understanding of what everything does, you can now make changes to configure it for your environment. In this example, you'll add properties to install npm when your codespace launches and make a list of ports inside the container available locally.
|
||||
|
||||
1. No Explorer, selecione o arquivo `devcontainer.json` a partir da árvore para abri-lo. Você pode ter que expandir a pasta `.devcontainer` para vê-la.
|
||||
1. In the Explorer, select the `devcontainer.json` file from the tree to open it. You might have to expand the `.devcontainer` folder to see it.
|
||||
|
||||

|
||||

|
||||
|
||||
2. Adicione as seguintes linhas ao seu arquivo `devcontainer.json` após as `extensões`:
|
||||
2. Add the following lines to your `devcontainer.json` file after `extensions`:
|
||||
|
||||
```json{:copy}
|
||||
"postCreateCommand": "npm install",
|
||||
"forwardPorts": [4000],
|
||||
```
|
||||
|
||||
Para obter mais informações sobre as propriedades `devcontainer.json`, consulte a referência de [devcontainer.json](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) na documentação de {% data variables.product.prodname_vscode %}.
|
||||
For more information on `devcontainer.json` properties, see the [devcontainer.json reference](https://code.visualstudio.com/docs/remote/devcontainerjson-reference) in the {% data variables.product.prodname_vscode %} docs.
|
||||
|
||||
{% data reusables.codespaces.rebuild-command %}
|
||||
|
||||
A reconstrução dentro do seu codespace garante que as suas alterações funcionem conforme o esperado antes de realizar o commit das alterações no repositório. Se algo falhar, você será colocado em um codespace com um contêiner de recuperação que você pode reconstruir para continuar ajustando o seu contêiner.
|
||||
Rebuilding inside your codespace ensures your changes work as expected before you commit the changes to the repository. If something does result in a failure, you’ll be placed in a codespace with a recovery container that you can rebuild from to keep adjusting your container.
|
||||
|
||||
|
||||
## Etapa 4: Execute o seu aplicativo
|
||||
## Step 4: Run your application
|
||||
|
||||
Na seção anterior, você usou o `postCreateCommand` para instalar um conjunto de pacotes via npm. Agora você pode usar isso para executar nosso aplicativo com npm.
|
||||
In the previous section, you used the `postCreateCommand` to installing a set of packages via npm. You can now use this to run our application with npm.
|
||||
|
||||
1. Execute seu comando inicial no terminal com`npm start`.
|
||||
1. Run your start command in the terminal with`npm start`.
|
||||
|
||||

|
||||

|
||||
|
||||
2. Quando o seu projeto for iniciado, você deverá ver um alerta no canto inferior direito com uma instrução para conectar-se à porta que seu projeto usa.
|
||||
2. When your project starts, you should see a toast in the bottom right corner with a prompt to connect to the port your project uses.
|
||||
|
||||

|
||||

|
||||
|
||||
## Etapa 5: Faça commit das suas alterações
|
||||
## Step 5: Commit your changes
|
||||
|
||||
{% data reusables.codespaces.committing-link-to-procedure %}
|
||||
|
||||
## Próximas etapas
|
||||
## Next steps
|
||||
|
||||
Agora você deve estar pronto para começar a desenvolver seu projeto JavaScript em {% data variables.product.prodname_codespaces %}. Aqui estão alguns recursos adicionais para cenários mais avançados.
|
||||
You should now be ready start developing your JavaScript project in {% data variables.product.prodname_codespaces %}. Here are some additional resources for more advanced scenarios.
|
||||
|
||||
- [Gerenciar segredos criptografados para seus codespaces](/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces)
|
||||
- [Gerenciar a verificação de GPG para {% data variables.product.prodname_codespaces %}](/codespaces/managing-your-codespaces/managing-gpg-verification-for-codespaces)
|
||||
- [Encaminhar portas no seu código](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)
|
||||
- [Managing encrypted secrets for your codespaces](/codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces)
|
||||
- [Managing GPG verification for {% data variables.product.prodname_codespaces %}](/codespaces/managing-your-codespaces/managing-gpg-verification-for-codespaces)
|
||||
- [Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
title: Adding a dev container to your repository
|
||||
shortTitle: Add a dev container to your repository
|
||||
allowTitleToDifferFromFilename: true
|
||||
intro: 'Get started with your Node.js, Python, .NET, or Java project in {% data variables.product.prodname_codespaces %} by creating a custom dev container.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
type: tutorial
|
||||
topics:
|
||||
- Codespaces
|
||||
- Developer
|
||||
- Node
|
||||
- JavaScript
|
||||
hasExperimentalAlternative: true
|
||||
interactive: true
|
||||
---
|
||||
|
||||
<!-- This article is specially rendered via the pages/ directory -->
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Configurando seu projeto em Python para Codespaces
|
||||
shortTitle: Configurando seu projeto Python
|
||||
intro: 'Dê os primeiros passos com seu projeto Python em {% data variables.product.prodname_codespaces %} criando um contêiner de desenvolvimento personalizado.'
|
||||
title: Setting up your Python project for Codespaces
|
||||
shortTitle: Setting up your Python project
|
||||
intro: 'Get started with your Python project in {% data variables.product.prodname_codespaces %} by creating a custom dev container.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -13,122 +13,127 @@ topics:
|
||||
- Codespaces
|
||||
- Developer
|
||||
- Python
|
||||
hasExperimentalAlternative: true
|
||||
hidden: true
|
||||
---
|
||||
|
||||
|
||||
|
||||
## Introdução
|
||||
## Introduction
|
||||
|
||||
Este guia mostra como configurar seu projeto Python em {% data variables.product.prodname_codespaces %}. Ele irá apresentar a você um exemplo de abertura de seu projeto em um codespace e adicionar e modificar uma configuração de contêiner de desenvolvimento a partir de um modelo.
|
||||
This guide shows you how to set up your Python project in {% data variables.product.prodname_codespaces %}. It will take you through an example of opening your project in a codespace, and adding and modifying a dev container configuration from a template.
|
||||
|
||||
### Pré-requisitos
|
||||
### Prerequisites
|
||||
|
||||
- Você deve ter um projeto Python existente em um repositório em {% data variables.product.prodname_dotcom_the_website %}. Se você não tiver um projeto, você poderá tentar este tutorial com o seguinte exemplo: https://github.com/2percentsilk/python-quickstart.
|
||||
- Você precisa ter {% data variables.product.prodname_codespaces %} habilitado para a sua organização.
|
||||
- You should have an existing Python project in a repository on {% data variables.product.prodname_dotcom_the_website %}. If you don't have a project, you can try this tutorial with the following example: https://github.com/2percentsilk/python-quickstart.
|
||||
- You must have {% data variables.product.prodname_codespaces %} enabled for your organization.
|
||||
|
||||
## Etapa 1: Abra o seu projeto em um codespace
|
||||
## Step 1: Open your project in a codespace
|
||||
|
||||
1. No nome do repositório, use o menu suspenso **Código de {% octicon "code" aria-label="The code icon" %}** e na aba **Codespaces** de código, clique em {% octicon "plus" aria-label="The plus icon" %} **Novo codespace**.
|
||||
1. Under the repository name, use the **{% octicon "code" aria-label="The code icon" %} Code** drop-down menu, and in the **Codespaces** tab, click {% octicon "plus" aria-label="The plus icon" %} **New codespace**.
|
||||
|
||||

|
||||

|
||||
|
||||
Se você não vir esta opção, significa que {% data variables.product.prodname_codespaces %} não está disponível para o seu projeto. Consulte [Acesso a {% data variables.product.prodname_codespaces %}](/codespaces/developing-in-codespaces/creating-a-codespace#access-to-codespaces) para mais informações.
|
||||
If you don’t see this option, {% data variables.product.prodname_codespaces %} isn't available for your project. See [Access to {% data variables.product.prodname_codespaces %}](/codespaces/developing-in-codespaces/creating-a-codespace#access-to-codespaces) for more information.
|
||||
|
||||
|
||||
|
||||
Ao criar um código, seu projeto será criado em uma VM remota dedicada a você. Por padrão, o contêiner para o seu código possui muitas linguagens e tempos de execução, incluindo Node.js, JavaScript, Typescript, nvm, npm e yarn. Ele também inclui um conjunto comum de ferramentas, como git, wget, rsync, openssh e nano.
|
||||
When you create a codespace, your project is created on a remote VM that is dedicated to you. By default, the container for your codespace has many languages and runtimes including Node.js, JavaScript, Typescript, nvm, npm, and yarn. It also includes a common set of tools like git, wget, rsync, openssh, and nano.
|
||||
|
||||
Você pode personalizar o seu codespace ajustando a quantidade de vCPUs e RAM, [adicionando dotfiles para personalizar seu ambiente](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account)ou modificando as ferramentas e scripts instalados.
|
||||
You can customize your codespace by adjusting the amount of vCPUs and RAM, [adding dotfiles to personalize your environment](/codespaces/setting-up-your-codespace/personalizing-codespaces-for-your-account), or by modifying the tools and scripts installed.
|
||||
|
||||
{% data variables.product.prodname_codespaces %} usa um arquivo denominado `devcontainer.json` para armazenar configurações. Ao iniciar, {% data variables.product.prodname_codespaces %} usa o arquivo para instalar quaisquer ferramentas, dependências ou outro conjunto que possa ser necessário para o projeto. Para obter mais informações, consulte "[Configurar codespaces para o seu projeto](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
{% data variables.product.prodname_codespaces %} uses a file called `devcontainer.json` to store configurations. On launch {% data variables.product.prodname_codespaces %} uses the file to install any tools, dependencies, or other set up that might be needed for the project. For more information, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
## Etapa 2: Adicione um contêiner de desenvolvimento ao seu codespace a partir de um modelo
|
||||
## Step 2: Add a dev container to your codespace from a template
|
||||
|
||||
O contêiner de códigos padrão vem com a versão mais recente do Python, gerenciadores de pacotes (pip, Miniconda) e outras ferramentas comuns pré-instaladas. No entanto, recomendamos que você configure um contêiner personalizado para definir as ferramentas e scripts de que seu projeto precisa. Isso garantirá um ambiente reprodutível para todos os usuários de {% data variables.product.prodname_codespaces %} do seu repositório.
|
||||
The default codespaces container comes with the latest Python version, package managers (pip, Miniconda), and other common tools preinstalled. However, we recommend that you set up a custom container to define the tools and scripts that your project needs. This will ensure a fully reproducible environment for all {% data variables.product.prodname_codespaces %} users in your repository.
|
||||
|
||||
Para configurar seu projeto com um contêiner personalizado, você deverá usar um arquivo `devcontainer.json` para definir o ambiente. Em {% data variables.product.prodname_codespaces %}, você pode adicionar isto a partir de um modelo ou você pode criar o seu próprio. Para obter mais informações sobre contêineres de desenvolvimento, consulte "[Configurar espaços de códigos para o seu projeto](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)".
|
||||
To set up your project with a custom container, you will need to use a `devcontainer.json` file to define the environment. In {% data variables.product.prodname_codespaces %} you can add this either from a template or you can create your own. For more information on dev containers, see "[Introduction to dev containers](/codespaces/setting-up-your-codespace/configuring-codespaces-for-your-project)."
|
||||
|
||||
|
||||
{% data reusables.codespaces.command-palette-container %}
|
||||
2. Para este exemplo, clique em **Python 3**. Se precisar de funcionalidades adicionais, você poderá selecionar qualquer contêiner específico para Python ou uma combinação de ferramentas como Python 3 e PostgreSQL. 
|
||||
3. Clique na versão recomendada do Python. 
|
||||
4. Aceite a opção padrão para adicionar Node.js à sua personalização. 
|
||||
2. For this example, click **Python 3**. If you need additional features you can select any container that’s specific to Python or a combination of tools such as Python 3 and PostgreSQL.
|
||||

|
||||
3. Click the recommended version of Python.
|
||||

|
||||
4. Accept the default option to add Node.js to your customization.
|
||||

|
||||
{% data reusables.codespaces.rebuild-command %}
|
||||
|
||||
### Anatomia do seu contêiner de desenvolvimento
|
||||
### Anatomy of your dev container
|
||||
|
||||
A adição do modelo de contêiner de desenvolvimento do Python adiciona uma pasta `.devcontainer` à raiz do repositório do seu projeto com os seguintes arquivos:
|
||||
Adding the Python dev container template adds a `.devcontainer` folder to the root of your project's repository with the following files:
|
||||
|
||||
- `devcontainer.json`
|
||||
- arquivo Docker
|
||||
- Dockerfile
|
||||
|
||||
O arquivo recém-adicionado `devcontainer.json` define algumas propriedades que são descritas após a amostra.
|
||||
The newly added `devcontainer.json` file defines a few properties that are described after the sample.
|
||||
|
||||
#### devcontainer.json
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "Python 3",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"context": "..",
|
||||
"args": {
|
||||
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
|
||||
"VARIANT": "3",
|
||||
// Options
|
||||
"INSTALL_NODE": "true",
|
||||
"NODE_VERSION": "lts/*"
|
||||
}
|
||||
},
|
||||
"name": "Python 3",
|
||||
"build": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"context": "..",
|
||||
"args": {
|
||||
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
|
||||
"VARIANT": "3",
|
||||
// Options
|
||||
"INSTALL_NODE": "true",
|
||||
"NODE_VERSION": "lts/*"
|
||||
}
|
||||
},
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash",
|
||||
"python.pythonPath": "/usr/local/bin/python",
|
||||
"python.linting.enabled": true,
|
||||
"python.linting.pylintEnabled": true,
|
||||
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
|
||||
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
|
||||
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
|
||||
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
|
||||
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
|
||||
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
|
||||
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
|
||||
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
|
||||
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
|
||||
},
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash",
|
||||
"python.pythonPath": "/usr/local/bin/python",
|
||||
"python.linting.enabled": true,
|
||||
"python.linting.pylintEnabled": true,
|
||||
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
|
||||
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
|
||||
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
|
||||
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
|
||||
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
|
||||
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
|
||||
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
|
||||
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
|
||||
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-python.python",
|
||||
],
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-python.python",
|
||||
],
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "pip3 install --user -r requirements.txt",
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "pip3 install --user -r requirements.txt",
|
||||
|
||||
// Comment out connect as root instead. Mais informações: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "vscode"
|
||||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
|
||||
"remoteUser": "vscode"
|
||||
}
|
||||
```
|
||||
|
||||
- **Nome** - Você pode dar qualquer nome ao nosso contêiner de desenvolvimento. Este é apenas o padrão.
|
||||
- **Build** - As propriedades de compilação.
|
||||
- **Arquivo Docker** - No objeto de compilação, `arquivo Docker` é uma referência ao arquivo arquivo Docker que também foi adicionado a partir do template.
|
||||
- **Name** - You can name our dev container anything, this is just the default.
|
||||
- **Build** - The build properties.
|
||||
- **Dockerfile** - In the build object, `dockerfile` is a reference to the Dockerfile that was also added from the template.
|
||||
- **Args**
|
||||
- **Variante**: Este arquivo contém apenas um argumento de compilação, que é a variante de nó que queremos usar e que é passada para o arquivo Docker.
|
||||
- **Configurações** - Estas são as configurações de {% data variables.product.prodname_vscode %}.
|
||||
- **Terminal.integrated.shell.linux** - Embora o bash seja o padrão, você pode usar outros shells do terminal, fazendo a modificação.
|
||||
- **Extensões** - Estas são extensões incluídas por padrão.
|
||||
- **ms-python. ython** - A extensão Microsoft Python fornece um amplo suporte para a linguagem do Python (para todas as versões ativamente compatíveis da linguagem: >=3.), incluindo recursos como IntelliSense, linting, depuração, navegação de código, formatação de código, refatoração, explorador de variáveis, explorador de teste e muito mais.
|
||||
- **forwardPorts** - Todas as portas listadas aqui serão encaminhadas automaticamente. Para obter mais informações, consulte "[Encaminhando portas no seu codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)".
|
||||
- **postCreateCommand** - Se você quiser executar qualquer coisa depois de pousar no seu codespace, isso não está definido no arquivo Docker como `pip3 install -r requirements`. Você pode fazer isso aqui.
|
||||
- **remoteUser** - Por padrão, você está executando como usuário do `vscode`, mas, opcionalmente, você pode definir isso como `root`.
|
||||
- **Variant**: This file only contains one build argument, which is the node variant we want to use that is passed into the Dockerfile.
|
||||
- **Settings** - These are {% data variables.product.prodname_vscode %} settings.
|
||||
- **Terminal.integrated.shell.linux** - While bash is the default here, you could use other terminal shells by modifying this.
|
||||
- **Extensions** - These are extensions included by default.
|
||||
- **ms-python.python** - The Microsoft Python extension provides rich support for the Python language (for all actively supported versions of the language: >=3.6), including features such as IntelliSense, linting, debugging, code navigation, code formatting, refactoring, variable explorer, test explorer, and more.
|
||||
- **forwardPorts** - Any ports listed here will be forwarded automatically. For more information, see "[Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)."
|
||||
- **postCreateCommand** - If you want to run anything after you land in your codespace that’s not defined in the Dockerfile, like `pip3 install -r requirements`, you can do that here.
|
||||
- **remoteUser** - By default, you’re running as the `vscode` user, but you can optionally set this to `root`.
|
||||
|
||||
#### arquivo Docker
|
||||
#### Dockerfile
|
||||
|
||||
```bash
|
||||
# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
|
||||
@@ -153,59 +158,59 @@ RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/l
|
||||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
||||
```
|
||||
|
||||
Você pode usar o arquivo Docker para adicionar camadas adicionais de contêiner para especificar os pacotes do OS, versões de nó ou pacotes globais que queremos que sejam incluídos no nosso contêiner.
|
||||
You can use the Dockerfile to add additional container layers to specify OS packages, node versions, or global packages we want included in our container.
|
||||
|
||||
## Etapa 3: Modifique seu arquivo devcontainer.json
|
||||
## Step 3: Modify your devcontainer.json file
|
||||
|
||||
Com o seu contêiner de desenvolvimento adicionado e um entendimento básico do que tudo faz, agora você pode fazer alterações para configurá-lo para o seu ambiente. Neste exemplo, você irá adicionar propriedades para instalar extensões e dependências do seu projeto quando seu codespace for iniciado.
|
||||
With your dev container added and a basic understanding of what everything does, you can now make changes to configure it for your environment. In this example, you'll add properties to install extensions and your project dependencies when your codespace launches.
|
||||
|
||||
1. No Explorador, expanda a pasta `.devcontainer` e selecione o arquivo `devcontainer.json` a partir da árvore para abri-lo.
|
||||
1. In the Explorer, expand the `.devcontainer` folder and select the `devcontainer.json` file from the tree to open it.
|
||||
|
||||

|
||||

|
||||
|
||||
2. Atualize a lista de extensões `` no seu arquivo `devcontainer.json` para adicionar algumas extensões que são úteis ao trabalhar com seu projeto.
|
||||
2. Update the `extensions` list in your `devcontainer.json` file to add a few extensions that are useful when working with your project.
|
||||
|
||||
```json{:copy}
|
||||
"extensions": [
|
||||
"ms-python.python",
|
||||
"cstrap.flask-snippets",
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
],
|
||||
"ms-python.python",
|
||||
"cstrap.flask-snippets",
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
],
|
||||
```
|
||||
|
||||
3. Remova o comentário o `postCreateCommand` para instalar automaticamente os requisitos como parte do processo de configuração dos codespaces.
|
||||
3. Uncomment the `postCreateCommand` to auto-install requirements as part of the codespaces setup process.
|
||||
|
||||
```json{:copy}
|
||||
// Use 'postCreateCommand' para executar os comandos após a criação do contêiner.
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
"postCreateCommand": "pip3 install --user -r requirements.txt",
|
||||
```
|
||||
|
||||
{% data reusables.codespaces.rebuild-command %}
|
||||
|
||||
A reconstrução dentro do seu codespace garante que as suas alterações funcionem conforme o esperado antes de realizar o commit das alterações no repositório. Se algo falhar, você será colocado em um codespace com um contêiner de recuperação que você pode reconstruir para continuar ajustando o seu contêiner.
|
||||
Rebuilding inside your codespace ensures your changes work as expected before you commit the changes to the repository. If something does result in a failure, you’ll be placed in a codespace with a recovery container that you can rebuild from to keep adjusting your container.
|
||||
|
||||
5. Verifique se suas alterações foram aplicadas com sucesso verificando se as extensões Code Spell Checker e Flask Snippet foram instaladas.
|
||||
5. Check your changes were successfully applied by verifying the Code Spell Checker and Flask Snippet extensions were installed.
|
||||
|
||||

|
||||

|
||||
|
||||
## Etapa 4: Execute o seu aplicativo
|
||||
## Step 4: Run your application
|
||||
|
||||
Na seção anterior, você usou o `postCreateCommand` para instalar um conjunto de pacotes via pip3. Com suas dependências agora instaladas, você pode executar seu aplicativo.
|
||||
In the previous section, you used the `postCreateCommand` to install a set of packages via pip3. With your dependencies now installed, you can run your application.
|
||||
|
||||
1. Execute seu aplicativo pressionando `F5` ou digitando `python -m Flask run` no terminal do codespace.
|
||||
1. Run your application by pressing `F5` or entering `python -m flask run` in the codespace terminal.
|
||||
|
||||
2. Quando o seu projeto for iniciado, você deverá ver um alerta no canto inferior direito com uma instrução para conectar-se à porta que seu projeto usa.
|
||||
2. When your project starts, you should see a toast in the bottom right corner with a prompt to connect to the port your project uses.
|
||||
|
||||

|
||||

|
||||
|
||||
## Etapa 5: Faça commit das suas alterações
|
||||
## Step 5: Commit your changes
|
||||
|
||||
{% data reusables.codespaces.committing-link-to-procedure %}
|
||||
|
||||
## Próximas etapas
|
||||
## Next steps
|
||||
|
||||
Agora você deve estar pronto para começar a desenvolver seu projeto Python em {% data variables.product.prodname_codespaces %}. Aqui estão alguns recursos adicionais para cenários mais avançados.
|
||||
You should now be ready start developing your Python project in {% data variables.product.prodname_codespaces %}. Here are some additional resources for more advanced scenarios.
|
||||
|
||||
- [Gerenciar segredos criptografados para {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-encrypted-secrets-for-codespaces)
|
||||
- [Gerenciar a verificação de GPG para {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-gpg-verification-for-codespaces)
|
||||
- [Encaminhar portas no seu código](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)
|
||||
- [Managing encrypted secrets for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-encrypted-secrets-for-codespaces)
|
||||
- [Managing GPG verification for {% data variables.product.prodname_codespaces %}](/codespaces/working-with-your-codespace/managing-gpg-verification-for-codespaces)
|
||||
- [Forwarding ports in your codespace](/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Armazenar suas credenciais do GitHub no Git
|
||||
title: Caching your GitHub credentials in Git
|
||||
redirect_from:
|
||||
- /firewalls-and-proxies/
|
||||
- /articles/caching-your-github-password-in-git
|
||||
@@ -7,77 +7,77 @@ redirect_from:
|
||||
- /github/using-git/caching-your-github-credentials-in-git
|
||||
- /github/getting-started-with-github/caching-your-github-credentials-in-git
|
||||
- /github/getting-started-with-github/getting-started-with-git/caching-your-github-credentials-in-git
|
||||
intro: 'Se você estiver [clonando repositórios de {% data variables.product.product_name %} que usam HTTPS](/github/getting-started-with-github/about-remote-repositories), recomendamos que você use {% data variables.product.prodname_cli %} ou Git Credential Manager Core (GCM Core) para lembrar suas credenciais.'
|
||||
intro: 'If you''re [cloning {% data variables.product.product_name %} repositories using HTTPS](/github/getting-started-with-github/about-remote-repositories), we recommend you use {% data variables.product.prodname_cli %} or Git Credential Manager (GCM) to remember your credentials.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
shortTitle: Armazenando credenciais
|
||||
shortTitle: Caching credentials
|
||||
---
|
||||
|
||||
{% tip %}
|
||||
|
||||
Dica de **:** Se você clonar {% data variables.product.product_name %} repositórios usando SSH, você pode efetuar a autenticação usando uma chave SSH em vez de usar outras credenciais. Para obter informações sobre como configurar uma conexão SSH, consulte "[Gerar uma chave SSH](/articles/generating-an-ssh-key)".
|
||||
**Tip:** If you clone {% data variables.product.product_name %} repositories using SSH, then you can authenticate using an SSH key instead of using other credentials. For information about setting up an SSH connection, see "[Generating an SSH Key](/articles/generating-an-ssh-key)."
|
||||
|
||||
{% endtip %}
|
||||
|
||||
## {% data variables.product.prodname_cli %}
|
||||
|
||||
{% data variables.product.prodname_cli %} armazenará automaticamente suas credenciais do Git para você escolher `HTTPS` como protocolo preferido para operações do Git e responder "sim" à instrução que pergunta se você gostaria de efetuar a autenticação no Git com a suas credenciais de {% data variables.product.product_name %}.
|
||||
{% data variables.product.prodname_cli %} will automatically store your Git credentials for you when you choose `HTTPS` as your preferred protocol for Git operations and answer "yes" to the prompt asking if you would like to authenticate to Git with your {% data variables.product.product_name %} credentials.
|
||||
|
||||
1. [Instale](https://github.com/cli/cli#installation) {% data variables.product.prodname_cli %} no macOS, Windows ou Linux.
|
||||
2. Na linha de comando, digite `gh auth login` e, em seguida, siga as instruções.
|
||||
- Quando for solicitado o protocolo preferido para operações do Git, selecione `HTTPS`.
|
||||
- Quando for perguntado se você gostaria de efetuar a autenticação no Git com as suas credenciais de {% data variables.product.product_name %}, insira `Y`.
|
||||
1. [Install](https://github.com/cli/cli#installation) {% data variables.product.prodname_cli %} on macOS, Windows, or Linux.
|
||||
2. In the command line, enter `gh auth login`, then follow the prompts.
|
||||
- When prompted for your preferred protocol for Git operations, select `HTTPS`.
|
||||
- When asked if you would like to authenticate to Git with your {% data variables.product.product_name %} credentials, enter `Y`.
|
||||
|
||||
Para mais informações sobre a autenticação com {% data variables.product.prodname_cli %}, consulte [`login gh`](https://cli.github.com/manual/gh_auth_login).
|
||||
For more information about authenticating with {% data variables.product.prodname_cli %}, see [`gh auth login`](https://cli.github.com/manual/gh_auth_login).
|
||||
|
||||
## Núcleo de Administração de Credenciais do Git
|
||||
## Git Credential Manager
|
||||
|
||||
O [Núcleo de Administração de Credenciais do Git](https://github.com/microsoft/Git-Credential-Manager-Core) (GCM Core) é outra maneira de armazenar suas credenciais de forma segura e conectar-se ao GitHub por HTTPS. Com Núcleo GCM, você não precisa [criar e armazenar um PAT](/github/authenticating-to-github/creating-a-personal-access-token) manualmente, uma vez que o Núcleo GCM gerencia a autenticação em seu nome, incluindo 2FA (autenticação de dois fatores).
|
||||
[Git Credential Manager](https://github.com/GitCredentialManager/git-credential-manager) (GCM) is another way to store your credentials securely and connect to GitHub over HTTPS. With GCM, you don't have to manually [create and store a PAT](/github/authenticating-to-github/creating-a-personal-access-token), as GCM manages authentication on your behalf, including 2FA (two-factor authentication).
|
||||
|
||||
{% mac %}
|
||||
|
||||
1. Instale o Git usando [Homebrew](https://brew.sh/):
|
||||
1. Install Git using [Homebrew](https://brew.sh/):
|
||||
```shell
|
||||
$ brew install git
|
||||
```
|
||||
|
||||
2. Instale o GCM Core usando o Homebrew:
|
||||
2. Install GCM using Homebrew:
|
||||
```shell
|
||||
$ brew tap microsoft/git
|
||||
$ brew install --cask git-credential-manager-core
|
||||
```
|
||||
Para MacOS, você não precisa executar a configuração do `git` porque o GCM Core configura o Git para você automaticamente.
|
||||
For MacOS, you don't need to run `git config` because GCM automatically configures Git for you.
|
||||
|
||||
{% data reusables.gcm-core.next-time-you-clone %}
|
||||
|
||||
Após a autenticação ser concluída com sucesso, suas credenciais serão armazenadas no keychain do macOS e serão usadas toda vez que você clonar uma URL de HTTPS. O Git não exigirá que você digite suas credenciais na linha de comando novamente, a menos que você altere suas credenciais.
|
||||
Once you've authenticated successfully, your credentials are stored in the macOS keychain and will be used every time you clone an HTTPS URL. Git will not require you to type your credentials in the command line again unless you change your credentials.
|
||||
|
||||
{% endmac %}
|
||||
|
||||
{% windows %}
|
||||
|
||||
1. Instale o Git para Windows, que inclui o GCM Core. Para obter mais informações, consulte "[Git para versões do Windows](https://github.com/git-for-windows/git/releases/latest)" a partir da sua [página de versões](https://github.com/git-for-windows/git/releases/latest).
|
||||
1. Install Git for Windows, which includes GCM. For more information, see "[Git for Windows releases](https://github.com/git-for-windows/git/releases/latest)" from its [releases page](https://github.com/git-for-windows/git/releases/latest).
|
||||
|
||||
Recomenda-se instalar sempre a versão mais recente. No mínimo, instale a versão 2.29 ou superior, que é a primeira versão que oferece suporte do OAuth para o GitHub.
|
||||
We recommend always installing the latest version. At a minimum, install version 2.29 or higher, which is the first version offering OAuth support for GitHub.
|
||||
|
||||
{% data reusables.gcm-core.next-time-you-clone %}
|
||||
|
||||
Depois de efetuar a autenticação com sucesso, as suas credenciais serão armazenadas no gerenciador de credenciais do Windows e serão usadas toda vez que você clonar uma URL de HTTPS. O Git não exigirá que você digite suas credenciais na linha de comando novamente, a menos que você altere suas credenciais.
|
||||
Once you've authenticated successfully, your credentials are stored in the Windows credential manager and will be used every time you clone an HTTPS URL. Git will not require you to type your credentials in the command line again unless you change your credentials.
|
||||
|
||||
<br>
|
||||
|
||||
{% warning %}
|
||||
|
||||
**Aviso:** As versões mais antigas do Git para Windows vieram com o Administrador de Credenciais do Git para Windows. Este produto antigo não é mais compatível e não pode se conectar ao GitHub via OAuth. Recomendamos que você faça atualização para [a versão mais recente do Git para Windows](https://github.com/git-for-windows/git/releases/latest).
|
||||
**Warning:** Older versions of Git for Windows came with Git Credential Manager for Windows. This older product is no longer supported and cannot connect to GitHub via OAuth. We recommend you upgrade to [the latest version of Git for Windows](https://github.com/git-for-windows/git/releases/latest).
|
||||
|
||||
{% endwarning %}
|
||||
|
||||
{% warning %}
|
||||
|
||||
**Aviso:** Se você fez cache de credenciais incorretas ou desatualizadas no Gerenciador de Credencial para Windows, o Git não terá acesso a {% data variables.product.product_name %}. Para redefinir as suas credenciais de cache para que o Git peça para inserir suas credenciais, acesse o Gerenciador de credenciais no Painel de Controle do Windows em Contas de Usuário > Gerenciador de Credenciais. Procure a entrada de {% data variables.product.product_name %} e exclua-a.
|
||||
**Warning:** If you cached incorrect or outdated credentials in Credential Manager for Windows, Git will fail to access {% data variables.product.product_name %}. To reset your cached credentials so that Git prompts you to enter your credentials, access the Credential Manager in the Windows Control Panel under User Accounts > Credential Manager. Look for the {% data variables.product.product_name %} entry and delete it.
|
||||
|
||||
{% endwarning %}
|
||||
|
||||
@@ -85,22 +85,22 @@ Depois de efetuar a autenticação com sucesso, as suas credenciais serão armaz
|
||||
|
||||
{% linux %}
|
||||
|
||||
Para Linux, instale o Git e GCM Core e, em seguida, configure o Git para usar o GCM Core.
|
||||
For Linux, install Git and GCM, then configure Git to use GCM.
|
||||
|
||||
1. Instale o Git a partir do sistema de pacotes da sua distribuição. As instruções vão variar dependendo da versão do Linux que você executar.
|
||||
1. Install Git from your distro's packaging system. Instructions will vary depending on the flavor of Linux you run.
|
||||
|
||||
2. Instale o GCM Core. Consulte as [instruções no repositório do GCM Core](https://github.com/microsoft/Git-Credential-Manager-Core#linux-install-instructions), já que elas variarão dependendo da versão do Linux que você executar.
|
||||
2. Install GCM. See the [instructions in the GCM repo](https://github.com/GitCredentialManager/git-credential-manager#linux-install-instructions), as they'll vary depending on the flavor of Linux you run.
|
||||
|
||||
3. Configure o Git para usar o GCM Core. Há várias lojas de apoio que você pode escolher. Portanto, consulte a documentação de do GCM Core para concluir a sua configuração. Para obter mais informações, consulte "[GCM Core Linux](https://aka.ms/gcmcore-linuxcredstores)".
|
||||
3. Configure Git to use GCM. There are several backing stores that you may choose from, so see the GCM docs to complete your setup. For more information, see "[GCM Linux](https://aka.ms/gcmcore-linuxcredstores)."
|
||||
|
||||
{% data reusables.gcm-core.next-time-you-clone %}
|
||||
|
||||
Depois de autenticado com sucesso, as suas credenciais serão armazenadas no seu sistema e serão usadas toda vez que você clonar uma URL de HTTPS. O Git não exigirá que você digite suas credenciais na linha de comando novamente, a menos que você altere suas credenciais.
|
||||
Once you've authenticated successfully, your credentials are stored on your system and will be used every time you clone an HTTPS URL. Git will not require you to type your credentials in the command line again unless you change your credentials.
|
||||
|
||||
Para obter mais opções para armazenar suas credenciais no Linux, consulte [Armazenamento de Credencial](https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage) no Pro Git.
|
||||
For more options for storing your credentials on Linux, see [Credential Storage](https://git-scm.com/book/en/v2/Git-Tools-Credential-Storage) in Pro Git.
|
||||
|
||||
{% endlinux %}
|
||||
|
||||
<br>
|
||||
|
||||
Para obter mais informações ou relatar problemas com o GCM Core, consulte a documentação oficial do Núcleo GCM em"[Núcleo do Gerenciador de Credenciais do Git](https://github.com/microsoft/Git-Credential-Manager-Core)".
|
||||
For more information or to report issues with GCM, see the official GCM docs at "[Git Credential Manager](https://github.com/GitCredentialManager/git-credential-manager)."
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Atualizar credenciais da keychain OSX
|
||||
intro: 'Você precisará atualizar suas credenciais salvas no auxiliar `git-credential-osxkeychain` se você alterar o seu {% ifversion not ghae %} nome de usuário, senha ou{% endif %} token de acesso pessoal em {% data variables.product.product_name %}.'
|
||||
title: Updating credentials from the macOS Keychain
|
||||
intro: 'You''ll need to update your saved credentials in the `git-credential-osxkeychain` helper if you change your{% ifversion not ghae %} username, password, or{% endif %} personal access token on {% data variables.product.product_name %}.'
|
||||
redirect_from:
|
||||
- /articles/updating-credentials-from-the-osx-keychain
|
||||
- /github/using-git/updating-credentials-from-the-osx-keychain
|
||||
@@ -12,39 +12,39 @@ versions:
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
shortTitle: Credenciais de keychain do macOS
|
||||
shortTitle: macOS Keychain credentials
|
||||
---
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Observação:** A atualização das credenciais do macOS Keychain aplica-se apenas a usuários que configuraram manualmente um PAT usando o auxiliar `osxkeychain` integrado ao macOS.
|
||||
**Note:** Updating credentials from the macOS Keychain only applies to users who manually configured a PAT using the `osxkeychain` helper that is built-in to macOS.
|
||||
|
||||
Recomendamos que você [configure o SSH](/articles/generating-an-ssh-key) ou faça a atualização para o [Núcleo de Administração de Credenciais do Git](/get-started/getting-started-with-git/caching-your-github-credentials-in-git) (GCM Core). O GCM Core pode gerenciar a autenticação em seu nome (sem PATs manuais), incluindo a 2FA (autenticação de dois fatores).
|
||||
We recommend you either [configure SSH](/articles/generating-an-ssh-key) or upgrade to the [Git Credential Manager](/get-started/getting-started-with-git/caching-your-github-credentials-in-git) (GCM) instead. GCM can manage authentication on your behalf (no more manual PATs) including 2FA (two-factor auth).
|
||||
|
||||
{% endtip %}
|
||||
|
||||
{% data reusables.user_settings.password-authentication-deprecation %}
|
||||
|
||||
## Atualizar credenciais pelo Keychain Access
|
||||
## Updating your credentials via Keychain Access
|
||||
|
||||
1. Clique no ícone do Spotlight (lente ampliada) no lado direito da barra de menu. Digite `Acesso da Keychain` e, em seguida, pressione a chave Enter para iniciar o aplicativo. 
|
||||
2. No Keychain Access, procure por **{% data variables.command_line.backticks %}**.
|
||||
3. Localize a entrada "internet password" (senha da internet) referente a `{% data variables.command_line.backticks %}`.
|
||||
4. Edite ou exclua a entrada de acordo.
|
||||
1. Click on the Spotlight icon (magnifying glass) on the right side of the menu bar. Type `Keychain access` then press the Enter key to launch the app.
|
||||

|
||||
2. In Keychain Access, search for **{% data variables.command_line.backticks %}**.
|
||||
3. Find the "internet password" entry for `{% data variables.command_line.backticks %}`.
|
||||
4. Edit or delete the entry accordingly.
|
||||
|
||||
## Excluir credenciais pela linha de comando
|
||||
## Deleting your credentials via the command line
|
||||
|
||||
Através da linha de comando, você pode usar o auxiliar de credenciais diretamente para apagar a entrada de keychain.
|
||||
Through the command line, you can use the credential helper directly to erase the keychain entry.
|
||||
|
||||
```shell
|
||||
$ git credential-osxkeychain erase
|
||||
host={% data variables.command_line.codeblock %}
|
||||
protocol=https
|
||||
> <em>[Pressione Return]</em>
|
||||
> <em>[Press Return]</em>
|
||||
```
|
||||
|
||||
Se a ação for bem-sucedida, nada será impresso. Para testar se funciona, tente clonar um repositório privado a partir de {% data variables.product.product_location %}. Se for solicitada uma senha, significa que a entrada da keychain foi excluída.
|
||||
If it's successful, nothing will print out. To test that it works, try and clone a private repository from {% data variables.product.product_location %}. If you are prompted for a password, the keychain entry was deleted.
|
||||
|
||||
## Leia mais
|
||||
## Further reading
|
||||
|
||||
- "[Armazenar suas credenciais de {% data variables.product.prodname_dotcom %} no Git](/github/getting-started-with-github/caching-your-github-credentials-in-git/)"
|
||||
- "[Caching your {% data variables.product.prodname_dotcom %} credentials in Git](/github/getting-started-with-github/caching-your-github-credentials-in-git/)"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Personalizando as visualizações do seu projeto (beta)
|
||||
intro: 'Exibe as informações de que você precisa alterando o layout, agrupamento, ordenação e filtros no seu projeto.'
|
||||
title: Customizing your project (beta) views
|
||||
intro: 'Display the information you need by changing the layout, grouping, sorting, and filters in your project.'
|
||||
allowTitleToDifferFromFilename: true
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -17,144 +17,169 @@ topics:
|
||||
Use the project command palette to quickly change settings and run commands in your project.
|
||||
|
||||
1. {% data reusables.projects.open-command-palette %}
|
||||
2. Comece a digitar qualquer parte de um comando ou navegue pela janela da paleta de comandos para encontrar um comando. Veja as próximas seções para mais exemplos de comandos.
|
||||
2. Start typing any part of a command or navigate through the command palette window to find a command. See the next sections for more examples of commands.
|
||||
|
||||
## Alterar o layout
|
||||
## Changing the project layout
|
||||
|
||||
Você pode visualizar o seu projeto como uma tabela ou como um quadro.
|
||||
You can view your project as a table or as a board.
|
||||
|
||||
1. {% data reusables.projects.open-command-palette %}
|
||||
2. Comece a digitar "Alternar layout".
|
||||
3. Selecione o comando desejado (por exemplo: "Layout de interrupção: tabela").
|
||||
3. Como alternativa, selecione o menu suspenso ao lado de um nome de exibição e clique em **Tabela** ou **Quadro**.
|
||||
2. Start typing "Switch layout".
|
||||
3. Choose the required command. For example, **Switch layout: Table**.
|
||||
3. Alternatively, click the drop-down menu next to a view name and click **Table** or **Board**.
|
||||
|
||||
## Exibir ou ocultar campos
|
||||
## Showing and hiding fields
|
||||
|
||||
You can show or hide a specific field.
|
||||
|
||||
In table layout:
|
||||
|
||||
1. {% data reusables.projects.open-command-palette %}
|
||||
2. Comece a digitar a ação que deseja realizar ("mostrar" ou "ocultar") ou o nome do campo.
|
||||
3. Selecione o comando desejado (por exemplo: "Exibir: Marco").
|
||||
4. Como alternativa, clique em {% octicon "plus" aria-label="the plus icon" %} à direita da tabela. No menu suspenso que aparece, indique quais campos mostrar ou ocultar. Um {% octicon "check" aria-label="check icon" %} indica quais campos serão exibidos.
|
||||
5. Como alternativa, selecione o menu suspenso ao lado do nome do campo e clique em **Ocultar o campo**.
|
||||
2. Start typing the action you want to take ("show" or "hide") or the name of the field.
|
||||
3. Choose the required command. For example, **Show: Milestone**.
|
||||
4. Alternatively, click {% octicon "plus" aria-label="the plus icon" %} to the right of the table. In the drop-down menu that appears, indicate which fields to show or hide. A {% octicon "check" aria-label="check icon" %} indicates which fields are displayed.
|
||||
5. Alternatively, click the drop-down menu next to the field name and click **Hide field**.
|
||||
|
||||
In board layout:
|
||||
|
||||
1. Selecione o menu suspenso ao lado do nome da visualização.
|
||||
1. Click the drop-down menu next to the view name.
|
||||
2. Under **configuration**, click {% octicon "list-unordered" aria-label="the unordered list icon" %}.
|
||||
3. In the menu that appears, select fields to add them and deselect fields to remove them from the view.
|
||||
3. In the menu that's displayed, select fields to add them and deselect fields to remove them from the view.
|
||||
|
||||
## Reordenar campos
|
||||
## Reordering fields
|
||||
|
||||
Você pode alterar a ordem dos campos.
|
||||
You can change the order of fields.
|
||||
|
||||
1. Clique no cabeçalho do campo.
|
||||
2. Ao clicar, arraste o campo para o local desejado.
|
||||
1. Click the field header.
|
||||
2. While clicking, drag the field to the required location.
|
||||
|
||||
## Reordenar linhas
|
||||
## Reordering rows
|
||||
|
||||
No layout da tabela, você pode alterar a ordem das linhas.
|
||||
In table layout, you can change the order of rows.
|
||||
|
||||
1. Clique no número no início da linha.
|
||||
2. Ao clicar, arraste a linha para o local desejado.
|
||||
1. Click the number at the start of the row.
|
||||
2. While clicking, drag the row to the required location.
|
||||
|
||||
## ordenar
|
||||
## Sorting by field values
|
||||
|
||||
No layout de tabela, você pode classificar itens por um valor de campo.
|
||||
In table layout, you can sort items by a field value.
|
||||
|
||||
1. {% data reusables.projects.open-command-palette %}
|
||||
2. Comece a digitar "Ordenar por" ou o nome do campo que deseja ordenar.
|
||||
3. Selecione o comando desejado (por exemplo: "Ordenar por: responsáveis, asc").
|
||||
4. Como alternativa, selecione o menu suspenso ao lado do nome do campo que deseja ordenar e clique em **Ordenar ascendentemente** ou **Ordenar descendentemente**.
|
||||
2. Start typing "Sort by" or the name of the field you want to sort by.
|
||||
3. Choose the required command. For example, **Sort by: Assignees, asc**.
|
||||
4. Alternatively, click the drop-down menu next to the field name that you want to sort by and click **Sort ascending** or **Sort descending**.
|
||||
|
||||
{% note %}
|
||||
|
||||
**Observação:** Quando uma tabela é ordenada, você não pode reordenar manualmente as linhas.
|
||||
**Note:** When a table is sorted, you cannot manually reorder rows.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
Siga passos semelhantes para remover uma ordenação.
|
||||
Follow similar steps to remove a sort.
|
||||
|
||||
1. {% data reusables.projects.open-command-palette %}
|
||||
2. Comece a digitar "Remover ordenação".
|
||||
3. Selecione o comando "Remover ordenação".
|
||||
4. Como alternativa, selecione o menu suspenso ao lado do nome da visualização e clique no item de menu que indique a classificação atual.
|
||||
2. Start typing "Remove sort-by".
|
||||
3. Choose **Remove sort-by**.
|
||||
4. Alternatively, click the drop-down menu next to the view name and click the menu item that indicates the current sort.
|
||||
|
||||
## Grupo
|
||||
## Grouping by field values
|
||||
|
||||
No layout da tabela, você pode agrupar os itens por um valor de campo personalizado. Quando os itens são agrupados, se você arrastar um item para um novo grupo, será aplicado o valor desse grupo. Por exemplo, se você agrupar por `Status` e, em seguida, arrastar um item com um status de `Em andamento` para o grupo `Concluído` o status do item mudará para `Concluído`.
|
||||
In the table layout, you can group items by a custom field value. When items are grouped, if you drag an item to a new group, the value of that group is applied. For example, if you group by "Status" and then drag an item with a status of `In progress` to the `Done` group, the status of the item will switch to `Done`.
|
||||
|
||||
{% note %}
|
||||
|
||||
**Observação:** Atualmente, você não pode agrupar por título, responsáveis, repositório ou etiquetas.
|
||||
**Note:** Currently, you cannot group by title, assignees, repository or labels.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
1. {% data reusables.projects.open-command-palette %}
|
||||
2. Comece a digitar "Agrupar por" ou o nome do campo que você deseja agrupar.
|
||||
3. Selecione o comando desejado (por exemplo, "Agrupar por: Status").
|
||||
4. Como alternativa, selecione o menu suspenso ao lado do nome do campo que você deseja agrupar e clique em **Agrupar por valores**.
|
||||
2. Start typing "Group by" or the name of the field you want to group by.
|
||||
3. Choose the required command. For example, **Group by: Status**.
|
||||
4. Alternatively, click the drop-down menu next to the field name that you want to group by and click **Group by values**.
|
||||
|
||||
Siga as etapas semelhantes para remover um agrupamento.
|
||||
Follow similar steps to remove a grouping.
|
||||
|
||||
1. {% data reusables.projects.open-command-palette %}
|
||||
2. Comece a digitar "Remover agrupamento".
|
||||
3. Selecione o comando "Remover agrupamento".
|
||||
4. Como alternativa, selecione o menu suspenso ao lado do nome da visualização e clique no item de menu que indique o agrupamento atual.
|
||||
2. Start typing "Remove group-by".
|
||||
3. Choose **Remove group-by**.
|
||||
4. Alternatively, click the drop-down menu next to the view name and click the menu item that indicates the current grouping.
|
||||
|
||||
## Filtrar
|
||||
## Filtering rows
|
||||
|
||||
Click {% octicon "search" aria-label="the search icon" %} at the top of the table to show the "Filter by keyword or field" bar. Start typing the field name and value that you want to filter by. À medida que você digita, serão exibidos os possíveis valores.
|
||||
Click {% octicon "search" aria-label="the search icon" %} at the top of the table to show the "Filter by keyword or field" bar. Start typing the field name and value that you want to filter by. As you type, possible values will appear.
|
||||
|
||||
- Para filtrar vários valores, separe os valores por uma vírgula. Por exemplo, `label:"good first issue",bug` irá listar todos os problemas com uma etiqueta `good first issue` ou `erro`.
|
||||
- Para filtrar pela ausência de um valor específico, insira `-` antes do seu filtro. Por exemplo, `-label:"bug"` mostrará apenas os itens que não têm a etiqueta `erro`.
|
||||
- Para filtrar pela ausência de todos os valores, digite `no:` seguido pelo nome do campo. Por exemplo, `no:assignee` irá mostrar apenas os itens que não têm um responsável.
|
||||
- To filter for multiple values, separate the values with a comma. For example `label:"good first issue",bug` will list all issues with a label `good first issue` or `bug`.
|
||||
- To filter for the absence of a specific value, place `-` before your filter. For example, `-label:"bug"` will only show items that do not have the label `bug`.
|
||||
- To filter for the absence of all values, enter `no:` followed by the field name. For example, `no:assignee` will only show items that do not have an assignee.
|
||||
- To filter by state, enter `is:`. For example, `is: issue` or `is:open`.
|
||||
- Separe vários filtros com um espaço. Por exemplo, `status:"In progress" -label:"bug" no:assignee` irá mostrar somente os itens que têm um status de `In progress`, não têm a etiqueta `erro` e não têm um responsável.
|
||||
- Separate multiple filters with a space. For example, `status:"In progress" -label:"bug" no:assignee` will show only items that have a status of `In progress`, do not have the label `bug`, and do not have an assignee.
|
||||
|
||||
Alternatively, use the command palette.
|
||||
|
||||
1. {% data reusables.projects.open-command-palette %}
|
||||
2. Comece a digitar "Filtrar por" ou o nome do campo que você deseja filtrar.
|
||||
3. Selecione o comando desejado (p. ex.: "Filtrar por status").
|
||||
4. Insira o valor que você deseja filtrar (por exemplo: "Em andamento"). Você também pode filtrar pela ausência de valores específicos (por exemplo: "Excluir status") ou pela ausência de todos os valores (por exemplo: "Sem status").
|
||||
2. Start typing "Filter by" or the name of the field you want to filter by.
|
||||
3. Choose the required command. For example, **Filter by Status**.
|
||||
4. Enter the value that you want to filter for. For example: "In progress". You can also filter for the absence of specific values (for example, choose "Exclude status" then choose a status) or the absence of all values (for example, "No status").
|
||||
|
||||
In board layout, you can click on item data to filter for items with that value. For example, click on an assignee to show only items for that assignee. To remove the filter, click the item data again.
|
||||
|
||||
## Salvar visualizações
|
||||
## Creating a project view
|
||||
|
||||
As visualizações salvas permitem que você visualize rapidamente aspectos específicos do seu projeto. Por exemplo, você poderia ter o seguinte:
|
||||
- uma visualização que mostra todos os itens não iniciados (filtrar por "status").
|
||||
- uma visualização que mostra a carga de trabalho para cada integrante da equipe (agrupar por "responsável e filtrar por "Status").
|
||||
- uma visualização que mostra itens com a data mais antiga de envio (classificar por um campo de data).
|
||||
Project views allow you to quickly view specific aspects of your project. Each view is displayed on a separate tab in your project.
|
||||
|
||||
As etapas a seguir demonstram como adicionar uma nova visualização:
|
||||
For example, you can have:
|
||||
- A view that shows all items not yet started (filter on "Status").
|
||||
- A view that shows the workload for each team member (group by "Assignee" and filter on "Status").
|
||||
- A view that shows the items with the earliest target ship date (sort by a date field).
|
||||
|
||||
To add a new view:
|
||||
|
||||
1. {% data reusables.projects.open-command-palette %}
|
||||
2. Comece a digitar "Nova visualização" (para criar uma nova visualização) ou "Duplicar visualização" (para duplicar a visualização atual).
|
||||
3. Selecione o comando desejado.
|
||||
4. Como alternativa, clique em {% octicon "plus" aria-label="the plus icon" %} **Nova Visualização** ao lado da visualização mais à direita.
|
||||
5. Como alternativa, selecione o menu suspenso ao lado de um nome de exibição e clique em **Duplicar visualização**.
|
||||
2. Start typing "New view" (to create a new view) or "Duplicate view" (to duplicate the current view).
|
||||
3. Choose the required command.
|
||||
4. Alternatively, click {% octicon "plus" aria-label="the plus icon" %} **New view** next to the rightmost view.
|
||||
5. Alternatively, click the drop-down menu next to a view name and click **Duplicate view**.
|
||||
|
||||
Ao alterar uma visualização, aparecerá um ponto ao lado do nome de visualização para indicar que a visualização foi modificada. Se você não desejar salvar as alterações, você poderá ignorar este indicador. Para salvar a visualização para todos os integrantes do projeto:
|
||||
The new view is automatically saved.
|
||||
|
||||
## Saving changes to a view
|
||||
|
||||
When you make changes to a view - for example, sorting, reordering, filtering, or grouping the data in a view - a dot is displayed next to the view name to indicate that there are unsaved changes.
|
||||
|
||||

|
||||
|
||||
If you don't want to save the changes, you can ignore this indicator. No one else will see your changes.
|
||||
|
||||
To save the current configuration of the view for all project members:
|
||||
1. {% data reusables.projects.open-command-palette %}
|
||||
1. Comece a digitar "Salvar visualização" ou "Salvar alterações na nova visualização".
|
||||
1. Selecione o comando desejado.
|
||||
1. Como alternativa, selecione o menu suspenso ao lado do nome de uma visualização e clique em **Salvar visualização** ou **SAlvar alterações na nova visualização**.
|
||||
1. Start typing "Save view" or "Save changes to new view".
|
||||
1. Choose the required command.
|
||||
1. Alternatively, click the drop-down menu next to a view name and click **Save view** or **Save changes to new view**.
|
||||
|
||||
Para renomear uma visualização, clique duas vezes no nome da visualização e digite o nome desejado.
|
||||
## Reordering saved views
|
||||
|
||||
Para excluir uma visualização:
|
||||
To change the order of the tabs that contain your saved views, click and drag a tab to a new location.
|
||||
|
||||
The new tab order is automatically saved.
|
||||
|
||||
## Renaming a saved view
|
||||
|
||||
To rename a view:
|
||||
1. Double click the name in the project tab.
|
||||
1. Change the name.
|
||||
1. Press Enter, or click outside of the tab.
|
||||
|
||||
The name change is automatically saved.
|
||||
|
||||
## Deleting a saved view
|
||||
|
||||
To delete a view:
|
||||
1. {% data reusables.projects.open-command-palette %}
|
||||
2. Comece a digitar "Excluir visualização".
|
||||
3. Selecione o comando desejado.
|
||||
4. Como alternativa, selecione o menu suspenso ao lado do nome de uma visualização e clique em **Excluir visualização**.
|
||||
2. Start typing "Delete view".
|
||||
3. Choose the required command.
|
||||
4. Alternatively, click the drop-down menu next to a view name and click **Delete view**.
|
||||
|
||||
## Leia mais
|
||||
## Further reading
|
||||
|
||||
- "[Sobre projetos (beta)](/issues/trying-out-the-new-projects-experience/about-projects)"
|
||||
- "[Criando um projeto (beta)](/issues/trying-out-the-new-projects-experience/creating-a-project)"
|
||||
- "[About projects (beta)](/issues/trying-out-the-new-projects-experience/about-projects)"
|
||||
- "[Creating a project (beta)](/issues/trying-out-the-new-projects-experience/creating-a-project)"
|
||||
|
||||
@@ -15,9 +15,9 @@ topics:
|
||||
|
||||
## About project access
|
||||
|
||||
Admins of organization-level projects can manage access to their organization's projects for everyone in the organization. Organization project admins can also manage access for individual organization members.
|
||||
Admins of organization-level projects can manage access for the entire organization, for teams, and for individual organization members.
|
||||
|
||||
Admins of user-level projects can invite collaborators and manage access for individual collaborators.
|
||||
Admins of user-level projects can invite individual collaborators and manage their access.
|
||||
|
||||
Project admins can also control the visibility of their project for everyone on the internet. For more information, see "[Managing the visibility of your projects](/issues/trying-out-the-new-projects-experience/managing-the-visibility-of-your-projects)."
|
||||
|
||||
@@ -35,17 +35,19 @@ The default base role is `write`, meaning that everyone in the organization can
|
||||
- **Write**: Everyone in the organization can see and edit the project. Organization owners are also admins for the project.
|
||||
- **Admin**: Everyone in the organization is an admin for the project.
|
||||
|
||||
### Managing access for individual members of your organization
|
||||
### Managing access for teams and individual members of your organization
|
||||
|
||||
You can also add individual organization members as collaborators to your project. Only organization members can be added as collaborators to organization projects.
|
||||
You can also add teams, and individual organization members, as collaborators. For more information, see "[About teams](/organizations/organizing-members-into-teams/about-teams)."
|
||||
|
||||
You can only invite an individual user to collaborate on your organization-level project if they are a member of the organization.
|
||||
|
||||
{% data reusables.projects.project-settings %}
|
||||
1. Click **Manage access**.
|
||||
1. Under **Invite collaborators**, search for the organization member that you want to invite.
|
||||
1. Under **Invite collaborators**, search for the team or organization member that you want to invite.
|
||||
1. Select the role for the collaborator.
|
||||
- **Read**: The individual can view the project.
|
||||
- **Write**: The individual can view and edit the project.
|
||||
- **Admin**: The individual can view, edit, and add new collaborators to the project.
|
||||
- **Read**: The team or individual can view the project.
|
||||
- **Write**: The team or individual can view and edit the project.
|
||||
- **Admin**: The team or individual can view, edit, and add new collaborators to the project.
|
||||
1. Click **Invite**.
|
||||
|
||||
### Managing access of an existing collaborator on your project
|
||||
@@ -53,6 +55,9 @@ You can also add individual organization members as collaborators to your projec
|
||||
{% data reusables.projects.project-settings %}
|
||||
1. Click **Manage access**.
|
||||
1. Under **Manage access**, find the collaborator(s) whose permissions you want to modify.
|
||||
|
||||
You can use the **Type** and **Role** drop-down menus to filter the access list.
|
||||
|
||||
1. Edit the role for the collaborator(s) or click {% octicon "trash" aria-label="the trash icon" %} to remove the collaborator(s).
|
||||
|
||||
## Managing access for user-level projects
|
||||
@@ -79,4 +84,7 @@ This only affects collaborators for your project, not for repositories in your p
|
||||
{% data reusables.projects.project-settings %}
|
||||
1. Click **Manage access**.
|
||||
1. Under **Manage access**, find the collaborator(s) whose permissions you want to modify.
|
||||
|
||||
You can use the **Role** drop-down menu to filter the access list.
|
||||
|
||||
1. Edit the role for the collaborator(s) or click {% octicon "trash" aria-label="the trash icon" %} to remove the collaborator(s).
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Equipes
|
||||
intro: 'Com a API de Equipes, você pode criar e gerenciar equipes na sua organização {% data variables.product.product_name %}.'
|
||||
title: Teams
|
||||
intro: 'With the Teams API, you can create and manage teams in your {% data variables.product.product_name %} organization.'
|
||||
redirect_from:
|
||||
- /v3/teams
|
||||
versions:
|
||||
@@ -13,36 +13,36 @@ topics:
|
||||
miniTocMaxHeadingLevel: 3
|
||||
---
|
||||
|
||||
Esta API só está disponível para os integrantes autenticados da [organização](/rest/reference/orgs) da equipe. Os tokens de acesso do OAuth exigem o escopo `read:org` [](/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). {% data variables.product.prodname_dotcom %} gera o `slug` da equipe a partir do `nome` da equipe.
|
||||
This API is only available to authenticated members of the team's [organization](/rest/reference/orgs). OAuth access tokens require the `read:org` [scope](/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). {% data variables.product.prodname_dotcom %} generates the team's `slug` from the team `name`.
|
||||
|
||||
{% for operation in currentRestOperations %}
|
||||
{% unless operation.subcategory %}{% include rest_operation %}{% endunless %}
|
||||
{% endfor %}
|
||||
|
||||
## Discussões
|
||||
## Discussions
|
||||
|
||||
A API de discussões de equipe permite que você obtenha, crie, edite e exclua postagens de discussão na página de uma equipe. Você pode usar discussões da equipe para ter conversas que não são específicas para um repositório ou projeto. Qualquer integrante da [organização](/rest/reference/orgs) da equipe pode criar e ler posts de discussão públicos. Para obter mais informações, consulte "[Sobre discussões de equipe](//organizations/collaborating-with-your-team/about-team-discussions/)". Para aprender mais sobre comentários em uma publicação de discussão, consulte [a API de comentários de discussão em equipe](/rest/reference/teams#discussion-comments). Esta API só está disponível para os integrantes autenticados da organização da equipe.
|
||||
The team discussions API allows you to get, create, edit, and delete discussion posts on a team's page. You can use team discussions to have conversations that are not specific to a repository or project. Any member of the team's [organization](/rest/reference/orgs) can create and read public discussion posts. For more details, see "[About team discussions](//organizations/collaborating-with-your-team/about-team-discussions/)." To learn more about commenting on a discussion post, see the [team discussion comments API](/rest/reference/teams#discussion-comments). This API is only available to authenticated members of the team's organization.
|
||||
|
||||
{% for operation in currentRestOperations %}
|
||||
{% if operation.subcategory == 'discussions' %}{% include rest_operation %}{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
## Comentários da discussão
|
||||
## Discussion comments
|
||||
|
||||
A API de comentários de discussão em equipe permite que você obtenha, crie, edite e exclua comentários de discussão em um post de [discussão de equipe](/rest/reference/teams#discussions). Qualquer integrante da organização da [organização](/rest/reference/orgs) da equipe pode criar e ler comentários em uma discussão pública. Para obter mais informações, consulte "[Sobre discussões de equipe](/organizations/collaborating-with-your-team/about-team-discussions/)". Esta API só está disponível para os integrantes autenticados da organização da equipe.
|
||||
The team discussion comments API allows you to get, create, edit, and delete discussion comments on a [team discussion](/rest/reference/teams#discussions) post. Any member of the team's [organization](/rest/reference/orgs) can create and read comments on a public discussion. For more details, see "[About team discussions](/organizations/collaborating-with-your-team/about-team-discussions/)." This API is only available to authenticated members of the team's organization.
|
||||
|
||||
{% for operation in currentRestOperations %}
|
||||
{% if operation.subcategory == 'discussion-comments' %}{% include rest_operation %}{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
## Integrantes
|
||||
## Members
|
||||
|
||||
Esta API só está disponível para os integrantes autenticados da organização da equipe. Os tokens de acesso do OAuth exigem o escopo `read:org` [](/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).
|
||||
This API is only available to authenticated members of the team's organization. OAuth access tokens require the `read:org` [scope](/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/).
|
||||
|
||||
{% ifversion fpt or ghes or ghec %}
|
||||
{% note %}
|
||||
|
||||
**Observação:** Quando você tiver configurado a sincronização da equipe para uma equipe com o provedor de identidade (IdP) da sua organização, você receberá uma mensagem de erro se tentar usar a API para fazer alterações na associação da equipe. Se você tiver acesso para administrar a associação do grupo em seu IdP, você pode administrar a associação da equipe do GitHub através do seu provedor de identidade, que adiciona e remove automaticamente os integrantes da equipe em uma organização. Para obter mais informações, consulte "<a href="/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization" class="dotcom-only">Sincronizar equipes entre seu provedor de identidade e o GitHub</a>".
|
||||
**Note:** When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "<a href="/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization" class="dotcom-only">Synchronizing teams between your identity provider and GitHub</a>."
|
||||
|
||||
{% endnote %}
|
||||
|
||||
@@ -52,21 +52,23 @@ Esta API só está disponível para os integrantes autenticados da organização
|
||||
{% if operation.subcategory == 'members' %}{% include rest_operation %}{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% ifversion ghec %}
|
||||
{% ifversion ghec or ghae %}
|
||||
## External groups
|
||||
|
||||
The external groups API allows you to view the external identity provider groups that are available to your organization and manage the connection between external groups and teams in your organization.
|
||||
|
||||
Para usar esta API, o usuário autenticado deve ser um mantenedor de equipe ou um proprietário da organização associada à equipe.
|
||||
To use this API, the authenticated user must be a team maintainer or an owner of the organization associated with the team.
|
||||
|
||||
{% ifversion ghec %}
|
||||
{% note %}
|
||||
|
||||
**Notas:**
|
||||
**Notes:**
|
||||
|
||||
- The external groups API is only available for organizations that are part of a enterprise using {% data variables.product.prodname_emus %}. For more information, see "[About Enterprise Managed Users](/admin/authentication/managing-your-enterprise-users-with-your-identity-provider/about-enterprise-managed-users)."
|
||||
- If your organization uses team synchronization, you can use the Team Synchronization API. For more information, see "[Team synchronization API](#team-synchronization)."
|
||||
|
||||
{% endnote %}
|
||||
{% endif %}
|
||||
|
||||
{% for operation in currentRestOperations %}
|
||||
{% if operation.subcategory == 'external-groups' %}{% include rest_operation %}{% endif %}
|
||||
@@ -75,15 +77,15 @@ Para usar esta API, o usuário autenticado deve ser um mantenedor de equipe ou u
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghes or ghec %}
|
||||
## Sincronização de equipes
|
||||
## Team synchronization
|
||||
|
||||
A API de Sincronização da Equipe permite que você gerencie as conexões entre equipes de {% data variables.product.product_name %} e grupos de provedor de identidade externo (IdP). Para usar esta API, o usuário autenticado deve ser um mantenedor de equipe ou um proprietário da organização associada à equipe. O token que você usa para efetuar a autenticação também deverá ser autorizado para uso com o provedor de IdP (SSO). Para obter mais informações, consulte "<a href="/github/authenticating-to-github/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on" class="dotcom-only">Autorizando um token de acesso pessoal para uso com uma organização de logon único SAML</a>".
|
||||
The Team Synchronization API allows you to manage connections between {% data variables.product.product_name %} teams and external identity provider (IdP) groups. To use this API, the authenticated user must be a team maintainer or an owner of the organization associated with the team. The token you use to authenticate will also need to be authorized for use with your IdP (SSO) provider. For more information, see "<a href="/github/authenticating-to-github/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on" class="dotcom-only">Authorizing a personal access token for use with a SAML single sign-on organization</a>."
|
||||
|
||||
Você pode gerenciar os integrantes da equipe do GitHub através do seu IdP com a sincronização de equipe. A sincronização de equipe deve estar habilitada para usar a API de sincronização de equipe. Para obter mais informações, consulte "<a href="/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization" class="dotcom-only">Sincronizar equipes entre seu provedor de identidade e o GitHub</a>".
|
||||
You can manage GitHub team members through your IdP with team synchronization. Team synchronization must be enabled to use the Team Synchronization API. For more information, see "<a href="/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization" class="dotcom-only">Synchronizing teams between your identity provider and GitHub</a>."
|
||||
|
||||
{% note %}
|
||||
|
||||
**Observação:** A API de sincronização de equipe não pode ser usada com {% data variables.product.prodname_emus %}. To learn more about managing an {% data variables.product.prodname_emu_org %}, see "[External groups API](/enterprise-cloud@latest/rest/reference/teams#external-groups)".
|
||||
**Note:** The Team Synchronization API cannot be used with {% data variables.product.prodname_emus %}. To learn more about managing an {% data variables.product.prodname_emu_org %}, see "[External groups API](/enterprise-cloud@latest/rest/reference/teams#external-groups)".
|
||||
|
||||
{% endnote %}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ sections:
|
||||
- Some critical services may not have been available on backend nodes in GHES Cluster.
|
||||
changes:
|
||||
- An additional outer layer of `gzip` compression when creating a cluster support bundle with `ghe-cluster-suport-bundle` is now turned off by default. This outer compression can optionally be applied with the `ghe-cluster-suport-bundle -c` command line option.
|
||||
- Upgraded collectd to version 5.12.0.
|
||||
- We have added extra text to the admin console to remind users about the mobile apps' data collection for experience improvement purposes.
|
||||
known_issues:
|
||||
- Em uma nova configuração de {% data variables.product.prodname_ghe_server %} sem qualquer usuário, um invasor pode criar o primeiro usuário administrador.
|
||||
|
||||
@@ -12,7 +12,6 @@ sections:
|
||||
- Some critical services may not have been available on backend nodes in GHES Cluster.
|
||||
changes:
|
||||
- An additional outer layer of `gzip` compression when creating a cluster support bundle with `ghe-cluster-suport-bundle` is now turned off by default. This outer compression can optionally be applied with the `ghe-cluster-suport-bundle -c` command line option.
|
||||
- Upgraded collectd to version 5.12.0.
|
||||
- We have added extra text to the admin console to remind users about the mobile apps' data collection for experience improvement purposes.
|
||||
known_issues:
|
||||
- O registro npm de {% data variables.product.prodname_registry %} não retorna mais o valor de tempo em respostas de metadados. Isso foi feito para permitir melhorias substanciais de desempenho. Continuamos a ter todos os dados necessários para devolver um valor de tempo como parte da resposta aos metadados e retomaremos o retorno desse valor no futuro, assim que tivermos resolvido os problemas de desempenho existentes.
|
||||
|
||||
@@ -53,9 +53,9 @@ sections:
|
||||
heading: 'Git Credential Manager (GCM) secure credential storage and multi-factor authentication support'
|
||||
notes:
|
||||
- |
|
||||
Git Credential Manager (GCM) Core versions 2.0.452 and later now provide security-hardened credential storage and multi-factor authentication support for {% data variables.product.product_name %}.
|
||||
Git Credential Manager (GCM) versions 2.0.452 and later now provide security-hardened credential storage and multi-factor authentication support for {% data variables.product.product_name %}.
|
||||
|
||||
GCM Core with support for {% data variables.product.product_name %} is included with [Git for Windows](https://gitforwindows.org) versions 2.32 and later. GCM Core is not included with Git for macOS or Linux, but can be installed separately. For more information, see the [latest release](https://github.com/microsoft/Git-Credential-Manager-Core/releases/) and [installation instructions](https://github.com/microsoft/Git-Credential-Manager-Core/releases/) in the `microsoft/Git-Credential-Manager-Core` repository.
|
||||
GCM with support for {% data variables.product.product_name %} is included with [Git for Windows](https://gitforwindows.org) versions 2.32 and later. GCM is not included with Git for macOS or Linux, but can be installed separately. For more information, see the [latest release](https://github.com/GitCredentialManager/git-credential-manager/releases/) and [installation instructions](https://github.com/GitCredentialManager/git-credential-manager/releases/) in the `GitCredentialManager/git-credential-manager` repository.
|
||||
changes:
|
||||
-
|
||||
heading: Alterações na administração
|
||||
|
||||
@@ -51,9 +51,9 @@ sections:
|
||||
heading: 'Git Credential Manager (GCM) secure credential storage and multi-factor authentication support'
|
||||
notes:
|
||||
- |
|
||||
Git Credential Manager (GCM) Core versions 2.0.452 and later now provide security-hardened credential storage and multi-factor authentication support for {% data variables.product.product_name %}.
|
||||
Git Credential Manager (GCM) versions 2.0.452 and later now provide security-hardened credential storage and multi-factor authentication support for {% data variables.product.product_name %}.
|
||||
|
||||
GCM Core with support for {% data variables.product.product_name %} is included with [Git for Windows](https://gitforwindows.org) versions 2.32 and later. GCM Core is not included with Git for macOS or Linux, but can be installed separately. For more information, see the [latest release](https://github.com/microsoft/Git-Credential-Manager-Core/releases/) and [installation instructions](https://github.com/microsoft/Git-Credential-Manager-Core/releases/) in the `microsoft/Git-Credential-Manager-Core` repository.
|
||||
GCM with support for {% data variables.product.product_name %} is included with [Git for Windows](https://gitforwindows.org) versions 2.32 and later. GCM is not included with Git for macOS or Linux, but can be installed separately. For more information, see the [latest release](https://github.com/GitCredentialManager/git-credential-manager/releases/) and [installation instructions](https://github.com/GitCredentialManager/git-credential-manager/releases/) in the `GitCredentialManager/git-credential-manager` repository.
|
||||
changes:
|
||||
-
|
||||
heading: Alterações na administração
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
date: '2021-11-23'
|
||||
intro: Os downloads foram desabilitados devido a um erro maior que afeta vários clientes. Uma correção estará disponível na próxima atualização.
|
||||
sections:
|
||||
security_fixes:
|
||||
- Os pacotes foram atualizados para as últimas versões de segurança.
|
||||
@@ -17,7 +18,6 @@ sections:
|
||||
- User defined patterns would not detect secrets in files like `package.json` or `yarn.lock`.
|
||||
changes:
|
||||
- An additional outer layer of `gzip` compression when creating a cluster support bundle with `ghe-cluster-suport-bundle` is now turned off by default. This outer compression can optionally be applied with the `ghe-cluster-suport-bundle -c` command line option.
|
||||
- Upgraded collectd to version 5.12.0.
|
||||
- We have added extra text to the admin console to remind users about the mobile apps' data collection for experience improvement purposes.
|
||||
known_issues:
|
||||
- Em uma nova configuração de {% data variables.product.prodname_ghe_server %} sem qualquer usuário, um invasor pode criar o primeiro usuário administrador.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
| Ação | Descrição |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |{% ifversion fpt or ghes > 3.1 or ghae-issue-1157 or ghec %}
|
||||
| Ação | Descrição |
|
||||
| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |{% ifversion fpt or ghes > 3.1 or ghae-issue-1157 or ghec %}
|
||||
| `cancel_workflow_run` | Acionada quando uma execução do fluxo de trabalho foi cancelada. Para obter mais informações, consulte "[Cancelando um fluxo de trabalho](/actions/managing-workflow-runs/canceling-a-workflow)".{% endif %}{% ifversion fpt or ghec or ghes > 3.2 or ghae-issue-4963 %}
|
||||
| `completed_workflow_run` | Acionada quando um status de fluxo de trabalho é alterado para `concluído`. Só pode ser visto usando a API REST; não visível na interface do usuário ou na exportação do JSON/CSV. Para obter mais informações, consulte "[Visualizar histórico de execução de fluxo de trabalho](/actions/managing-workflow-runs/viewing-workflow-run-history)".{% endif %}{% ifversion fpt or ghec or ghes > 3.2 or ghae-issue-4963 %}
|
||||
| `created_workflow_run` | Acionada quando uma execução do fluxo de trabalho é criada. Só pode ser visto usando a API REST; não visível na interface do usuário ou na exportação do JSON/CSV. Para obter mais informações, consulte "[Criar um exemplo de um fluxo de trabalho](/actions/learn-github-actions/introduction-to-github-actions#create-an-example-workflow)".{% endif %}{% ifversion fpt or ghes > 3.1 or ghae-issue-1157 or ghec %}
|
||||
| `delete_workflow_run` | Acionada quando a execução do fluxo de trabalho é excluída. Para obter mais informações, consulte "[Excluir uma execução de fluxo de trabalho](/actions/managing-workflow-runs/deleting-a-workflow-run)". |
|
||||
| `disable_workflow` | Acionada quando um fluxo de trabalho está desabilitado. |
|
||||
| `enable_workflow` | Acionada quando um fluxo de trabalho é habilitado, depois de previamente desabilitado por `disable_workflow`. |
|
||||
| `delete_workflow_run` | Acionada quando a execução do fluxo de trabalho é excluída. Para obter mais informações, consulte "[Excluir uma execução de fluxo de trabalho](/actions/managing-workflow-runs/deleting-a-workflow-run)". |
|
||||
| `disable_workflow` | Acionada quando um fluxo de trabalho está desabilitado. |
|
||||
| `enable_workflow` | Acionada quando um fluxo de trabalho é habilitado, depois de previamente desabilitado por `disable_workflow`. |
|
||||
| `rerun_workflow_run` | Acionada quando uma execução do fluxo de trabalho é executada novamente. Para obter mais informações, consulte "[Executar novamente um fluxo de trabalho](/actions/managing-workflow-runs/re-running-a-workflow)".{% endif %}{% ifversion fpt or ghec or ghes > 3.2 or ghae-issue-4963 %}
|
||||
| `prepared_workflow_job` | Acionada quando um trabalho no fluxo de trabalho é iniciado. Inclui a lista de segredos que foram fornecidos ao trabalho. Só pode ser visto usando a API REST; não visível na interface do usuário ou na exportação do JSON/CSV. Para obter mais informações, consulte "[Eventos que acionam fluxos de trabalho](/actions/reference/events-that-trigger-workflows)".{% endif %}{% ifversion fpt or ghes > 3.1 or ghae-issue-1157 or ghec %}
|
||||
| `approve_workflow_job` | Acionada quando um trabalho no fluxo de trabalho foi aprovado. Para obter mais informações, consulte "[Revisando implantações](/actions/managing-workflow-runs/reviewing-deployments)." |
|
||||
| `prepared_workflow_job` | Acionada quando um trabalho no fluxo de trabalho é iniciado. Inclui a lista de segredos que foram fornecidos ao trabalho. Can only be viewed using the REST API. It is not visible in the the {% data variables.product.prodname_dotcom %} web interface or included in the JSON/CSV export. Para obter mais informações, consulte "[Eventos que acionam fluxos de trabalho](/actions/reference/events-that-trigger-workflows)".{% endif %}{% ifversion fpt or ghes > 3.1 or ghae-issue-1157 or ghec %}
|
||||
| `approve_workflow_job` | Acionada quando um trabalho no fluxo de trabalho foi aprovado. Para obter mais informações, consulte "[Revisando implantações](/actions/managing-workflow-runs/reviewing-deployments)." |
|
||||
| `reject_workflow_job` | Acionada quando um trabalho no fluxo de trabalho foi rejeitado. Para obter mais informações, consulte "[Revisando implantações](/actions/managing-workflow-runs/reviewing-deployments)".{% endif %}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
To pass named inputs to a called workflow, use the `with` keyword in a job. Use a palavra-chave `segredos` para passar segredos nomeados. For inputs, the data type of the input value must match the type specified in the called workflow (either boolean, number, or string).
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
call-workflow-passing-data:
|
||||
uses: octo-org/example-repo/.github/workflows/reusable-workflow.yml@main
|
||||
with:
|
||||
username: mona
|
||||
secrets:
|
||||
envPAT: ${{ secrets.envPAT }}
|
||||
```
|
||||
{% endraw %}
|
||||
@@ -19,10 +19,10 @@
|
||||
</table>
|
||||
{%- ifversion fpt or ghes > 3.0 or ghae-next %}
|
||||
|
|
||||
{% data variables.product.prodname_codeql %} | Usando {% data variables.product.prodname_actions %} (consulte "[Configurar {% data variables.product.prodname_code_scanning %} usando ações](/github/finding-security-vulnerabilities-and-errors-in-your-code/setting-up-code-scanning-for-a-repository#setting-up-code-scanning-using-actions)") ou executando {% data variables.product.prodname_codeql %} análise em um sistema de integração contínua (CI) de terceiros (consulte "[Sobre {% data variables.product.prodname_codeql %} {% data variables.product.prodname_code_scanning %} no seu sistema CI](/code-security/secure-coding/about-codeql-code-scanning-in-your-ci-system)").
|
||||
{% data variables.product.prodname_codeql %} | Using {% data variables.product.prodname_actions %} (see "[Setting up {% data variables.product.prodname_code_scanning %} using actions](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository#setting-up-code-scanning-using-actions)") or running {% data variables.product.prodname_codeql %} analysis in a third-party continuous integration (CI) system (see "[About {% data variables.product.prodname_codeql %} {% data variables.product.prodname_code_scanning %} in your CI system](/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/about-codeql-code-scanning-in-your-ci-system)").
|
||||
{%- else %}
|
||||
|
|
||||
{% data variables.product.prodname_codeql %} | Usando {% data variables.product.prodname_actions %} (consulte "[Configurar {% data variables.product.prodname_code_scanning %} usando ações](/github/finding-security-vulnerabilities-and-errors-in-your-code/setting-up-code-scanning-for-a-repository#setting-up-code-scanning-using-actions)") ou usando o sistema {% data variables.product.prodname_codeql_runner %} em uma integração contínua (CI) de terceiros (consulte "[Executando a digitalização de código {% data variables.product.prodname_codeql %} no seu sistema CI](/github/finding-security-vulnerabilities-and-errors-in-your-code/running-codeql-code-scanning-in-your-ci-system)").
|
||||
{% data variables.product.prodname_codeql %} | Using {% data variables.product.prodname_actions %} (see "[Setting up {% data variables.product.prodname_code_scanning %} using actions](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository#setting-up-code-scanning-using-actions)") or using the {% data variables.product.prodname_codeql_runner %} in a third-party continuous integration (CI) system (see "[Running {% data variables.product.prodname_codeql_runner %} in your CI system](/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/running-codeql-runner-in-your-ci-system)").
|
||||
{%- endif %}
|
||||
| Terceiros‑ | Usando
|
||||
{% data variables.product.prodname_actions %} (consulte "[Configurar {% data variables.product.prodname_code_scanning %} usando ações](/github/finding-security-vulnerabilities-and-errors-in-your-code/setting-up-code-scanning-for-a-repository#setting-up-code-scanning-using-actions)") ou gerado externamente e enviado para {% data variables.product.product_name %} (consulte "[Fazer o upload de um arquivo SARIF para {% data variables.product.prodname_dotcom %}](/github/finding-security-vulnerabilities-and-errors-in-your-code/uploading-a-sarif-file-to-github)").├
|
||||
{% data variables.product.prodname_actions %} (see "[Setting up {% data variables.product.prodname_code_scanning %} using actions](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository#setting-up-code-scanning-using-actions)") or generated externally and uploaded to {% data variables.product.product_name %} (see "[Uploading a SARIF file to {% data variables.product.prodname_dotcom %}](/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)").|
|
||||
|
||||
@@ -64,7 +64,9 @@ GitHub | GitHub OAuth Access Token | github_oauth_access_token{% endif %}
|
||||
{%- ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
GitHub | GitHub Refresh Token | github_refresh_token{% endif %}
|
||||
{%- ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
GitHub | GitHub App Installation Access Token | github_app_installation_access_token{% endif %} GitHub | GitHub SSH Private Key | github_ssh_private_key GoCardless | GoCardless Live Access Token | gocardless_live_access_token GoCardless | GoCardless Sandbox Access Token | gocardless_sandbox_access_token
|
||||
GitHub | GitHub App Installation Access Token | github_app_installation_access_token{% endif %} GitHub | GitHub SSH Private Key | github_ssh_private_key
|
||||
{%- ifversion fpt or ghec or ghes > 3.3 %}
|
||||
GitLab | GitLab Access Token | gitlab_access_token{% endif %} GoCardless | GoCardless Live Access Token | gocardless_live_access_token GoCardless | GoCardless Sandbox Access Token | gocardless_sandbox_access_token
|
||||
{%- ifversion fpt or ghec or ghes > 3.2 %}
|
||||
Google | Firebase Cloud Messaging Server Key | firebase_cloud_messaging_server_key{% endif %} Google | Google API Key | google_api_key Google | Google Cloud Private Key ID | google_cloud_private_key_id
|
||||
{%- ifversion fpt or ghec or ghes > 3.2 %}
|
||||
@@ -156,7 +158,8 @@ Stripe | Stripe Test API Restricted Key | stripe_test_restricted_key{% endif %}
|
||||
{%- ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
Stripe | Stripe Webhook Signing Secret | stripe_webhook_signing_secret{% endif %}
|
||||
{%- ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
Tableau | Tableau Personal Access Token | tableau_personal_access_token{% endif %}
|
||||
{%- ifversion fpt or ghec or ghes > 3.3 %}
|
||||
Supabase | Supabase Service Key | supabase_service_key{% endif %} Tableau | Tableau Personal Access Token | tableau_personal_access_token{% endif %}
|
||||
{%- ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
Telegram | Telegram Bot Token | telegram_bot_token{% endif %} Tencent Cloud | Tencent Cloud Secret ID | tencent_cloud_secret_id
|
||||
{%- ifversion fpt or ghec or ghes > 3.3 %}
|
||||
|
||||
@@ -5,9 +5,9 @@ intro: Learn how to avoid duplication when creating a workflow by reusing existi
|
||||
miniTocMaxHeadingLevel: 3
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
ghes: '>=3.4'
|
||||
ghae: issue-4757
|
||||
ghec: '*'
|
||||
type: how_to
|
||||
topics:
|
||||
- Workflows
|
||||
@@ -17,17 +17,15 @@ topics:
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
{% data reusables.actions.ae-beta %}
|
||||
|
||||
{% note %}
|
||||
## Overview
|
||||
|
||||
**Note:** Reusable workflows are currently in beta and subject to change.
|
||||
Rather than copying and pasting from one workflow to another, you can make workflows reusable. You and anyone with access to the reusable workflow can then call the reusable workflow from another workflow.
|
||||
|
||||
{% endnote %}
|
||||
Reusing workflows avoids duplication. This makes workflows easier to maintain and allows you to create new workflows more quickly by building on the work of others, just as you do with actions. Workflow reuse also promotes best practice by helping you to use workflows that are well designed, have already been tested, and have been proved to be effective. Your organization can build up a library of reusable workflows that can be centrally maintained.
|
||||
|
||||
## 概览
|
||||
The diagram below shows three build jobs on the left of the diagram. After each of these jobs completes successfully a dependent job called "Deploy" runs. This job calls a reusable workflow that contains three jobs: "Staging", "Review", and "Production." The "Production" deployment job only runs after the "Staging" job has completed successfully. Using a reusable workflow to run deployment jobs allows you to run those jobs for each build without duplicating code in workflows.
|
||||
|
||||
Rather than copying and pasting from one workflow to another, you can make workflows reusable. You and anyone with access to the reusable workflow can then call the reusable workflow from another workflow.
|
||||
|
||||
Reusing workflows avoids duplication. This makes workflows easier to maintain and allows you to create new workflows more quickly by building on the work of others, just as you do with actions. Workflow reuse also promotes best practice by helping you to use workflows that are well designed, have already been tested, and have been proved to be effective. Your organization can build up a library of reusable workflows that can be centrally maintained.
|
||||

|
||||
|
||||
A workflow that uses another workflow is referred to as a "caller" workflow. The reusable workflow is a "called" workflow. One caller workflow can use multiple called workflows. Each called workflow is referenced in a single line. The result is that the caller workflow file may contain just a few lines of YAML, but may perform a large number of tasks when it's run. When you reuse a workflow, the entire called workflow is used, just as if it was part of the caller workflow.
|
||||
|
||||
@@ -35,23 +33,43 @@ If you reuse a workflow from a different repository, any actions in the called w
|
||||
|
||||
When a reusable workflow is triggered by a caller workflow, the `github` context is always associated with the caller workflow. The called workflow is automatically granted access to `github.token` and `secrets.GITHUB_TOKEN`. For more information about the `github` context, see "[Context and expression syntax for GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#github-context)."
|
||||
|
||||
### Reusable workflows and workflow templates
|
||||
|
||||
Workflow templates allow everyone in your organization who has permission to create workflows to do so more quickly and easily. When people create a new workflow, they can choose a template and some or all of the work of writing the workflow will be done for them. Inside workflow templates, you can also reference reusable workflows to make it easy for people to benefit from reusing centrally managed workflow code. If you use a tag or branch name when referencing the reusable workflow then you can ensure that everyone who reuses that workflow will always be using the same YAML code. However, if you reference a reusable workflow by a tag or branch, be sure that you can trust that version of the workflow. For more information, see "[Security hardening for {% data variables.product.prodname_actions %}](/actions/security-guides/security-hardening-for-github-actions#reusing-third-party-workflows)."
|
||||
|
||||
For more information, see "[Creating workflow templates](/actions/learn-github-actions/creating-workflow-templates)."
|
||||
|
||||
## Access to reusable workflows
|
||||
|
||||
A reusable workflow can be used by another workflow if any of the following is true:
|
||||
A reusable workflow can be used by another workflow if {% ifversion ghes or ghec or ghae %}any{% else %}either{% endif %} of the following is true:
|
||||
|
||||
* Both workflows are in the same repository.
|
||||
* The called workflow is stored in a public repository.
|
||||
* The called workflow is stored in an internal repository and the settings for that repository allow it to be accessed. 更多信息请参阅“[管理仓库的 {% data variables.product.prodname_actions %} 设置](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)”。
|
||||
* The called workflow is stored in a public repository.{% ifversion ghes or ghec or ghae %}
|
||||
* The called workflow is stored in an internal repository and the settings for that repository allow it to be accessed. For more information, see "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)."{% endif %}
|
||||
|
||||
## 限制
|
||||
## Using runners
|
||||
|
||||
### Using GitHub-hosted runners
|
||||
|
||||
{% ifversion fpt or ghes or ghec %}
|
||||
The assignment of {% data variables.product.prodname_dotcom %}-hosted runners is always evaluated using only the caller's context. Billing for {% data variables.product.prodname_dotcom %}-hosted runners is always associated with the caller. The caller workflow cannot use {% data variables.product.prodname_dotcom %}-hosted runners from the called repository. For more information, see "[About {% data variables.product.prodname_dotcom %}-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners)."
|
||||
{% endif %}
|
||||
{% ifversion ghae %}
|
||||
The assignment of {% data variables.actions.hosted_runner %}s is always evaluated using only the caller's context. Billing for {% data variables.actions.hosted_runner %}s is always associated with the caller. The caller cannot use {% data variables.actions.hosted_runner %}s from the called repository. For more information, see "[About {% data variables.actions.hosted_runner %}s](/github-ae@latest/actions/using-github-hosted-runners/about-ae-hosted-runners)."
|
||||
{% endif %}
|
||||
|
||||
### Using self-hosted runners
|
||||
|
||||
Called workflows can access self-hosted runners from caller's context. This means that a called workflow can access self-hosted runners that are:
|
||||
* In the caller repository
|
||||
* In the caller repository's organization{% ifversion ghes or ghec or ghae %} or enterprise{% endif %}, provided that the runner has been made available to the caller repository
|
||||
|
||||
## Limitations
|
||||
|
||||
* Reusable workflows can't call other reusable workflows.
|
||||
* Reusable workflows stored within a private repository can only be used by workflows within the same repository.
|
||||
* Any environment variables set in an `env` context defined at the workflow level in the caller workflow are not propagated to the called workflow. For more information about the `env` context, see "[Context and expression syntax for GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#env-context)."
|
||||
|
||||
The following limitations will be removed when workflow reuse moves out of beta:
|
||||
* You can't set the concurrency of a called workflow from the caller workflow. For more information about `jobs.<job_id>.concurrency`, see "[Workflow syntax for GitHub Actions](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idconcurrency)."
|
||||
* Outputs generated by a called workflow can't be accessed by the caller workflow.
|
||||
|
||||
## Creating a reusable workflow
|
||||
|
||||
@@ -64,30 +82,55 @@ on:
|
||||
workflow_call:
|
||||
```
|
||||
|
||||
You can define inputs and secrets, which can be passed from the caller workflow and then used within the called workflow. The following example, from a reusable workflow, defines two inputs (called "ring" and "environment") and one secret (called "token"):
|
||||
### Using inputs and secrets in a reusable workflow
|
||||
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ring:
|
||||
description: 'Identifier for the target deployment ring'
|
||||
default: 'ring-0'
|
||||
required: false
|
||||
type: string
|
||||
environment:
|
||||
required: false
|
||||
type: string
|
||||
secrets:
|
||||
token:
|
||||
required: false
|
||||
```
|
||||
You can define inputs and secrets, which can be passed from the caller workflow and then used within the called workflow. There are three stages to using an input or a secret in a reusable workflow.
|
||||
|
||||
For details of the syntax for defining inputs and secrets, see [on.workflow_call.inputs](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callinputs) and [on.workflow_call.secrets](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callsecrets).
|
||||
1. In the reusable workflow, use the `inputs` and `secrets` keywords to define inputs or secrets that will be passed from a caller workflow.
|
||||
{% raw %}
|
||||
```yaml
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
username:
|
||||
required: true
|
||||
type: string
|
||||
secrets:
|
||||
envPAT:
|
||||
required: true
|
||||
```
|
||||
{% endraw %}
|
||||
For details of the syntax for defining inputs and secrets, see [`on.workflow_call.inputs`](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callinputs) and [`on.workflow_call.secrets`](/actions/reference/workflow-syntax-for-github-actions#onworkflow_callsecrets).
|
||||
1. Reference the input or secret in the reusable workflow.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
reusable_workflow_job:
|
||||
runs-on: ubuntu-latest
|
||||
environment: production
|
||||
steps:
|
||||
- uses: ./.github/actions/my-action@v1
|
||||
with:
|
||||
username: ${{ inputs.username }}
|
||||
token: ${{ secrets.envPAT }}
|
||||
```
|
||||
{% endraw %}
|
||||
In the example above, `envPAT` is an environment secret that's been added to the `production` environment. This environment is therefore referenced within the job.
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note**: Environment secrets are encrypted strings that are stored in an environment that you've defined for a repository. Environment secrets are only available to workflow jobs that reference the appropriate environment. For more information, see "[Using environments for deployment](/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-secrets)."
|
||||
|
||||
{% endnote %}
|
||||
|
||||
1. Pass the input or secret from the caller workflow.
|
||||
|
||||
{% indented_data_reference reusables.actions.pass-inputs-to-reusable-workflows spaces=3 %}
|
||||
|
||||
### Example reusable workflow
|
||||
|
||||
This reusable workflow file named `workflow-B.yml` (we'll refer to this later) takes an input string and a secret from the caller workflow and uses them in an action.
|
||||
This reusable workflow file named `workflow-B.yml` (we'll refer to this later in the [example caller workflow](#example-caller-workflow)) takes an input string and a secret from the caller workflow and uses them in an action.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
@@ -121,7 +164,7 @@ You call a reusable workflow by using the `uses` keyword. Unlike when you are us
|
||||
|
||||
[`jobs.<job_id>.uses`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_iduses)
|
||||
|
||||
You reference reusable workflow files using the syntax:
|
||||
You reference reusable workflow files using the syntax:
|
||||
|
||||
`{owner}/{repo}/{path}/{filename}@{ref}`
|
||||
|
||||
@@ -131,16 +174,7 @@ You can call multiple workflows, referencing each in a separate job.
|
||||
|
||||
### Passing inputs and secrets to a reusable workflow
|
||||
|
||||
Use the `with` keyword in a job to pass named inputs to the called workflow. Use the `secrets` keyword to pass named secrets. The inputs and secrets you pass must be defined in the called workflow. For inputs, the data type of the input value must match the type specified for that input in the called workflow (boolean, number, or string).
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
with:
|
||||
username: mona
|
||||
secrets:
|
||||
token: ${{ secrets.TOKEN }}
|
||||
```
|
||||
{% endraw %}
|
||||
{% data reusables.actions.pass-inputs-to-reusable-workflows%}
|
||||
|
||||
### Supported keywords for jobs that call a reusable workflow
|
||||
|
||||
@@ -158,16 +192,16 @@ When you call a reusable workflow, you can only use the following keywords in th
|
||||
|
||||
{% note %}
|
||||
|
||||
**注:**
|
||||
**Note:**
|
||||
|
||||
* If `jobs.<job_id>.permissions` is not specified in the calling job, the called workflow will have the default permissions for the `GITHUB_TOKEN`. 更多信息请参阅“[工作流程中的身份验证](/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token)。
|
||||
* If `jobs.<job_id>.permissions` is not specified in the calling job, the called workflow will have the default permissions for the `GITHUB_TOKEN`. For more information, see "[Authentication in a workflow](/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token)."
|
||||
* The `GITHUB_TOKEN` permissions passed from the caller workflow can be only downgraded (not elevated) by the called workflow.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
### Example caller workflow
|
||||
|
||||
This workflow file calls two workflow files. The second of these, `workflow-B.yml` (shown above), is passed an input, `username`, and a secret, `token`.
|
||||
This workflow file calls two workflow files. The second of these, `workflow-B.yml` (shown in the [example reusable workflow](#example-reusable-workflow)), is passed an input (`username`) and a secret (`token`).
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
@@ -191,6 +225,82 @@ jobs:
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## 后续步骤
|
||||
## Using outputs from a reusable workflow
|
||||
|
||||
A reusable workflow may generate data that you want to use in the caller workflow. To use these outputs, you must specify them as the outputs of the reusable workflow.
|
||||
|
||||
The following reusable workflow has a single job containing two steps. In each of these steps we set a single word as the output: "hello" and "world." In the `outputs` section of the job, we map these step outputs to job outputs called: `output1` and `output2`. In the `on.workflow_call.outputs` section we then define two outputs for the workflow itself, one called `firstword` which we map to `output1`, and one called `secondword` which we map to `output2`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Reusable workflow
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
# Map the workflow outputs to job outputs
|
||||
outputs:
|
||||
firstword:
|
||||
description: "The first output string"
|
||||
value: ${{ jobs.example_job.outputs.output1 }}
|
||||
secondword:
|
||||
description: "The second output string"
|
||||
value: ${{ jobs.example_job.outputs.output2 }}
|
||||
|
||||
jobs:
|
||||
example_job:
|
||||
name: Generate output
|
||||
runs-on: ubuntu-latest
|
||||
# Map the job outputs to step outputs
|
||||
outputs:
|
||||
output1: ${{ steps.step1.outputs.firstword }}
|
||||
output2: ${{ steps.step2.outputs.secondword }}
|
||||
steps:
|
||||
- id: step1
|
||||
run: echo "::set-output name=firstword::hello"
|
||||
- id: step2
|
||||
run: echo "::set-output name=secondword::world"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
We can now use the outputs in the caller workflow, in the same way you would use the outputs from a job within the same workflow. We reference the outputs using the names defined at the workflow level in the reusable workflow: `firstword` and `secondword`. In this workflow, `job1` calls the reusable workflow and `job2` prints the outputs from the reusable workflow ("hello world") to standard output in the workflow log.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Call a reusable workflow and use its outputs
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
job1:
|
||||
uses: octo-org/example-repo/.github/workflows/called-workflow.yml@v1
|
||||
|
||||
job2:
|
||||
runs-on: ubuntu-latest
|
||||
needs: job1
|
||||
steps:
|
||||
- run: echo ${{ needs.job1.outputs.firstword }} ${{ needs.job1.outputs.secondword }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
For more information on using job outputs, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idoutputs)."
|
||||
|
||||
## Monitoring which workflows are being used
|
||||
|
||||
You can use the {% data variables.product.prodname_dotcom %} REST API to monitor how reusable workflows are being used. The `prepared_workflow_job` audit log action is triggered when a workflow job is started. Included in the data recorded are:
|
||||
* `repo` - the organization/repository where the workflow job is located. For a job that calls another workflow, this is the organization/repository of the caller workflow.
|
||||
* `@timestamp` - the date and time that the job was started, in Unix epoch format.
|
||||
* `job_name` - the name of the job that was run.
|
||||
* `job_workflow_ref` - the workflow file that was used, in the form `{owner}/{repo}/{path}/{filename}@{ref}`. For a job that calls another workflow, this identifies the called workflow.
|
||||
|
||||
For information about using the REST API to query the audit log for an organization, see "[Organizations](/rest/reference/orgs#get-the-audit-log-for-an-organization)."
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note**: Audit data for `prepared_workflow_job` can only be viewed using the REST API. It is not visible in the {% data variables.product.prodname_dotcom %} web interface, or included in JSON/CSV exported audit data.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
## Next steps
|
||||
|
||||
To continue learning about {% data variables.product.prodname_actions %}, see "[Events that trigger workflows](/actions/learn-github-actions/events-that-trigger-workflows)."
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Customizing your codespace
|
||||
intro: '{% data variables.product.prodname_codespaces %} 是您专用的环境。 You can configure your repositories with a dev container to define their default Codespaces environment, and personalize your development experience across all of your codespaces with dotfiles and Settings Sync.'
|
||||
intro: '{% data variables.product.prodname_codespaces %} is a dedicated environment for you. You can configure your repositories with a dev container to define their default Codespaces environment, and personalize your development experience across all of your codespaces with dotfiles and Settings Sync.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -10,8 +10,10 @@ redirect_from:
|
||||
topics:
|
||||
- Codespaces
|
||||
children:
|
||||
- /configuring-codespaces-for-your-project
|
||||
- /personalizing-codespaces-for-your-account
|
||||
- /changing-the-machine-type-for-your-codespace
|
||||
- /setting-your-default-editor-for-codespaces
|
||||
- /setting-your-default-region-for-codespaces
|
||||
- /prebuilding-codespaces-for-your-project
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: 在代码空间中开发
|
||||
intro: '创建代码空间,以便在专用云环境中开始开发您的项目。 您可以使用转发端口运行应用程序,甚至可以使用 {% data variables.product.prodname_vscode %} 内的代码空间'
|
||||
title: Developing in a codespace
|
||||
intro: 'Create a codespace to get started with developing your project inside a dedicated cloud environment. You can use forwarded ports to run your application and even use codespaces inside {% data variables.product.prodname_vscode %}'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -15,8 +15,7 @@ children:
|
||||
- /using-codespaces-for-pull-requests
|
||||
- /deleting-a-codespace
|
||||
- /forwarding-ports-in-your-codespace
|
||||
- /changing-the-machine-type-for-your-codespace
|
||||
- /using-codespaces-in-visual-studio-code
|
||||
- /using-codespaces-with-github-cli
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: 管理代码空间
|
||||
intro: '您可以使用 {% data variables.product.prodname_github_codespaces %} 设置来管理代码空间可能需要的信息。'
|
||||
title: Managing your codespaces
|
||||
intro: 'You can use {% data variables.product.prodname_github_codespaces %} settings to manage information that your codespace might need.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -14,7 +14,5 @@ children:
|
||||
- /managing-repository-access-for-your-codespaces
|
||||
- /reviewing-your-security-logs-for-codespaces
|
||||
- /managing-gpg-verification-for-codespaces
|
||||
- /setting-your-default-editor-for-codespaces
|
||||
- /setting-your-default-region-for-codespaces
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
title: 'Setting up your project for {% data variables.product.prodname_codespaces %}'
|
||||
intro: '了解如何开始使用 {% data variables.product.prodname_codespaces %},包括特定语言的设置和配置。'
|
||||
title: 'Setting up your repository for {% data variables.product.prodname_codespaces %}'
|
||||
allowTitleToDifferFromFilename: true
|
||||
intro: 'Learn how to get started with {% data variables.product.prodname_codespaces %}, including set up and configuration for specific languages.'
|
||||
product: '{% data reusables.gated-features.codespaces %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -8,6 +9,8 @@ versions:
|
||||
redirect_from:
|
||||
- /codespaces/getting-started-with-codespaces
|
||||
children:
|
||||
- /configuring-codespaces-for-your-project
|
||||
- /setting-up-your-project-for-codespaces
|
||||
- /setting-up-your-nodejs-project-for-codespaces
|
||||
- /setting-up-your-dotnet-project-for-codespaces
|
||||
- /setting-up-your-java-project-for-codespaces
|
||||
|
||||
@@ -77,7 +77,8 @@ To search for specific events, use the `action` qualifier in your query. Actions
|
||||
| [`secret_scanning_new_repos`](#secret_scanning_new_repos-category-actions) | Contains organization-level configuration activities for secret scanning for new repositories created in the organization. {% ifversion fpt or ghec %}
|
||||
| [`sponsors`](#sponsors-category-actions) | Contains all events related to sponsor buttons (see "[Displaying a sponsor button in your repository](/articles/displaying-a-sponsor-button-in-your-repository)"){% endif %}
|
||||
| [`team`](#team-category-actions) | Contains all activities related to teams in your organization.
|
||||
| [`team_discussions`](#team_discussions-category-actions) | Contains activities related to managing team discussions for an organization.
|
||||
| [`team_discussions`](#team_discussions-category-actions) | Contains activities related to managing team discussions for an organization.{% ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
| [`workflows`](#workflows-category-actions) | Contains activities related to {% data variables.product.prodname_actions %} workflows.{% endif %}
|
||||
|
||||
You can search for specific sets of actions using these terms. For example:
|
||||
|
||||
@@ -743,10 +744,11 @@ For more information, see "[Managing the publication of {% data variables.produc
|
||||
| `disable` | Triggered when an organization owner disables team discussions for an organization. For more information, see "[Disabling team discussions for your organization](/articles/disabling-team-discussions-for-your-organization)."
|
||||
| `enable` | Triggered when an organization owner enables team discussions for an organization.
|
||||
|
||||
{% ifversion fpt or ghec or ghes > 3.1 or ghae-next %}
|
||||
### `workflows` category actions
|
||||
|
||||
{% data reusables.actions.actions-audit-events-workflow %}
|
||||
|
||||
{% endif %}
|
||||
## Further reading
|
||||
|
||||
- "[Keeping your organization secure](/articles/keeping-your-organization-secure)"{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5146 %}
|
||||
|
||||
Reference in New Issue
Block a user