New translation batch for es (#26670)
This commit is contained in:
@@ -35,7 +35,7 @@ Si tu organización utiliza {% data variables.product.prodname_ghe_cloud %}, tam
|
||||
|
||||
Si una cuenta empresarial administra tu organización, entonces puedes ver a los propietarios de la empresa que administran los ajustes de facturación y las políticas de todas las organizaciones de esta. Para obtener más información sobre las cuentas empresariales, consulta la sección "[Tipos de cuenta de {% data variables.product.prodname_dotcom %}](/get-started/learning-about-github/types-of-github-accounts)".
|
||||
|
||||
También puedes ver si un propietario de empresa tiene un rol específico en la organización. Los propietarios de las empresas también pueden ser miembros de una organización, tener cualquier otro rol en ella o estar desafiliados de la misma.
|
||||
También puedes ver si un propietario de empresa tiene un rol específico en la organización. Enterprise owners can also be an organization member, any other organization role, or be un-affiliated with the organization.
|
||||
|
||||
{% note %}
|
||||
|
||||
@@ -43,11 +43,11 @@ También puedes ver si un propietario de empresa tiene un rol específico en la
|
||||
|
||||
{% endnote %}
|
||||
|
||||
| **Roles en la empresa** | **Roles en la organización** | **Acceso o impacto a la organización** |
|
||||
| ----------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Propietario de empresa | Desafiliados o sin rol oficial en la organización | No puede acceder al contenido de la organización ni a sus repositorios, pero administra los ajustes y políticas de la empresa que impactan a tu organización. |
|
||||
| Propietario de empresa | Propietario de la organización | Puede configurar los ajustes de la organización y administrar el acceso a los recursos de la misma mediante equipos, etc. |
|
||||
| Propietario de empresa | Miembro de la organización | Puede acceder a los recursos y contenido de la organización, tales como repositorios, sin acceder a los ajustes de la misma. |
|
||||
| **Roles en la empresa** | **Roles en la organización** | **Acceso o impacto a la organización** |
|
||||
| ----------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Propietario de empresa | Un-affiliated or no official organization role | No puede acceder al contenido de la organización ni a sus repositorios, pero administra los ajustes y políticas de la empresa que impactan a tu organización. |
|
||||
| Propietario de empresa | Propietario de la organización | Puede configurar los ajustes de la organización y administrar el acceso a los recursos de la misma mediante equipos, etc. |
|
||||
| Propietario de empresa | Miembro de la organización | Puede acceder a los recursos y contenido de la organización, tales como repositorios, sin acceder a los ajustes de la misma. |
|
||||
|
||||
Para revisar todos los roles en una organización, consulta la sección "[Roles en una organización](/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization)". {% ifversion ghec %} Los miembros de la organización también pueden tener roles personalizados para un repositorio específico. Para obtener más información, consulta la sección "[Administrar los roles personalizados de repositorio en una organización](/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization)".{% endif %}
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ Para comenzar rápidamente, puedes elegir el flujo de trabajo inicial de Ant pre
|
||||
|
||||
También puedes agregar este flujo de trabajo de forma manual al crear un archivo nuevo en el directorio de tu repositorio `.github/workflows`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Java CI
|
||||
|
||||
@@ -59,16 +58,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Build with Ant
|
||||
run: ant -noinput -buildfile build.xml
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Este flujo de trabajo realiza los siguientes pasos:
|
||||
|
||||
@@ -90,18 +88,16 @@ El flujo de trabajo de inicio ejecutará el destino predeterminado especificado
|
||||
|
||||
Si usas diferentes comandos para construir tu proyecto, o si deseas ejecutar un objetivo diferente, puedes especificarlos. Por ejemplo, es posible que desees ejecutar el destino `jar` que está configurado en tu archivo `-ci.xml_`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Run the Ant jar target
|
||||
run: ant -noinput -buildfile build-ci.xml jar
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Empaquetar datos de flujo de trabajo como artefactos
|
||||
|
||||
@@ -109,19 +105,17 @@ Una vez que tu compilación haya tenido éxito y tus pruebas hayan pasado, es po
|
||||
|
||||
Por lo general, Ant crea archivos de salida como JAR, EAR o WAR en el directorio `build/jar`. Puedes cargar los contenidos de ese directorio utilizando la acción `upload-Artifact`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
|
||||
- run: ant -noinput -buildfile build.xml
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: Package
|
||||
path: build/jar
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
@@ -60,16 +60,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
|
||||
- name: Build with Gradle
|
||||
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
|
||||
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
|
||||
with:
|
||||
arguments: build
|
||||
```
|
||||
@@ -95,22 +95,20 @@ El flujo de trabajo de inicio ejecutará la tarea `build` por defecto. En la con
|
||||
|
||||
Si usas diferentes comandos para construir tu proyecto, o si quieres usar una tarea diferente, puedes especificarlo. Por ejemplo, es posible que desees ejecutar la tarea `package` que está configurada en tu archivo _ci.gradle_.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
|
||||
- name: Run the Gradle package task
|
||||
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
|
||||
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
|
||||
with:
|
||||
arguments: -b ci.gradle package
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Almacenar dependencias en caché
|
||||
|
||||
@@ -124,23 +122,21 @@ Una vez que tu compilación haya tenido éxito y tus pruebas hayan pasado, es po
|
||||
|
||||
Por lo general, Gradle creará archivos de salida como JAR, EAR o WAR en el directorio `build/libs`. Puedes cargar los contenidos de ese directorio utilizando la acción `upload-Artifact`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
|
||||
- name: Build with Gradle
|
||||
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
|
||||
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
|
||||
with:
|
||||
arguments: build
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: Package
|
||||
path: build/libs
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
@@ -48,7 +48,6 @@ Para iniciar rápidamente, puedes elegir el flujo de trabajo inicial de Maven pr
|
||||
|
||||
También puedes agregar este flujo de trabajo de forma manual al crear un archivo nuevo en el directorio de tu repositorio `.github/workflows`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Java CI
|
||||
|
||||
@@ -59,16 +58,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Build with Maven
|
||||
run: mvn --batch-mode --update-snapshots verify
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Este flujo de trabajo realiza los siguientes pasos:
|
||||
|
||||
@@ -90,29 +88,26 @@ El flujo de trabajo de inicio ejecutará el `paquete` destino por defecto. En la
|
||||
|
||||
Si usas diferentes comandos para compilar tu proyecto, o si quieres usar un destino diferente, puedes especificarlos. Por ejemplo, es posible que desees ejecutar el objetivo `verify (verificar)` que está configurado en un archivo _pom-ci.xml_.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Run the Maven verify phase
|
||||
run: mvn --batch-mode --update-snapshots verify
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Almacenar dependencias en caché
|
||||
|
||||
Cuando utilizas ejecutores hospedados en {% data variables.product.prodname_dotcom %}, puedes guardar tus dependencias en el caché para acelerar tus ejecuciones de flujo de trabajo. Después de una ejecución exitosa, tu repositorio Maven local se almacenará en la infraestructura de acciones de GitHub. En las ejecuciones de flujo de trabajo futuras, el caché se restaurará para que las dependencias no necesiten descargarse desde los repositorios remotos de Maven. Puedes guardar las dependencias en caché utilizando simplemente la [acción `setup-java`](https://github.com/marketplace/actions/setup-java-jdk) o puedes utilizar la [Acción `cache`](https://github.com/actions/cache) para tener una configuración personalizada y más avanzada.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
@@ -120,7 +115,6 @@ steps:
|
||||
- name: Build with Maven
|
||||
run: mvn --batch-mode --update-snapshots verify
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Este flujo de trabajo guardará los contenidos de tu repositorio local de Maven, ubicado en el directorio `.m2` del directorio de inicio del ejecutor. La clave de caché será el contenido con hash de _pom.xml_, por lo que los cambios en _pom.xml_ invalidará el caché.
|
||||
|
||||
@@ -130,19 +124,17 @@ Una vez que tu compilación haya tenido éxito y tus pruebas hayan pasado, es po
|
||||
|
||||
Por lo general, Maven creará archivos de salida como tarros, orejas o guerras en el `Objetivo` Directorio. Para cargarlos como artefactos, puedes copiarlos en un nuevo directorio que contenga artefactos para cargar. Por ejemplo, puedes crear un directorio llamado `staging` (preparación). Luego puedes cargar los contenidos de ese directorio usando la acción `upload-artifact (cargar artefacto)`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- run: mvn --batch-mode --update-snapshots verify
|
||||
- run: mkdir staging && cp target/*.jar staging
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: Package
|
||||
path: staging
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
@@ -34,8 +34,6 @@ Te recomendamos que tengas un entendimiento básico de .NET Core SDK. Para obten
|
||||
|
||||
Para comenzar rápidamente, agrega el flujo de trabajo inicial al directorio de `.github/workflows` de tu repositorio.
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
name: dotnet package
|
||||
|
||||
@@ -50,11 +48,11 @@ jobs:
|
||||
dotnet-version: ['3.0', '3.1.x', '5.0.x' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
|
||||
uses: actions/setup-dotnet@v1.7.2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Setup .NET Core SDK {% raw %}${{ matrix.dotnet-version }}{% endraw %}
|
||||
uses: {% data reusables.actions.action-setup-dotnet %}
|
||||
with:
|
||||
dotnet-version: ${{ matrix.dotnet-version }}
|
||||
dotnet-version: {% raw %}${{ matrix.dotnet-version }}{% endraw %}
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
@@ -63,8 +61,6 @@ jobs:
|
||||
run: dotnet test --no-restore --verbosity normal
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
## Especificar una versión de .NET
|
||||
|
||||
Para utilizar una versión preinstalada de .NET Core SDK en un ejecutor hospedado en {% data variables.product.prodname_dotcom %}, utiliza la acción `setup-dotnet`. Esta acción encuentra una versión específica de .NET desde el caché de las herramientas en cada ejecutor y agrega los binarios necesarios a `PATH`. Estos cambios persistirán para el recordatorio del job.
|
||||
@@ -73,7 +69,6 @@ La acción `setup-dotnet` es la forma recomendada de utilizar .NET con las {% da
|
||||
|
||||
### Utilizar versiones múltiples de .NET
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: dotnet package
|
||||
|
||||
@@ -88,47 +83,42 @@ jobs:
|
||||
dotnet-version: [ '3.0', '3.1.x', '5.0.x' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup dotnet ${{ matrix.dotnet-version }}
|
||||
uses: actions/setup-dotnet@v1
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Setup dotnet {% raw %}${{ matrix.dotnet-version }}{% endraw %}
|
||||
uses: {% data reusables.actions.action-setup-dotnet %}
|
||||
with:
|
||||
dotnet-version: ${{ matrix.dotnet-version }}
|
||||
dotnet-version: {% raw %}${{ matrix.dotnet-version }}{% endraw %}
|
||||
# You can test your matrix by printing the current dotnet version
|
||||
- name: Display dotnet version
|
||||
run: dotnet --version
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Utilizar una versión específica de .NET
|
||||
|
||||
Puedes configurar tu job para que utilice una versión específica de .NET, tal como la `3.1.3`. Como alternativa, puedes utilizar una sintaxis de versión semántica para obtener el último lanzamiento menor. Este ejemplo utiliza el lanzamiento menor más reciente de .NET 3.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
- name: Setup .NET 3.x
|
||||
uses: actions/setup-dotnet@v1
|
||||
uses: {% data reusables.actions.action-setup-dotnet %}
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a dotnet version
|
||||
dotnet-version: '3.x'
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Instalar dependencias
|
||||
|
||||
Los ejecutores hospedados en {% data variables.product.prodname_dotcom %} cuentan con el administrador de paquetes NuGet ya instalado. Puedes utilizar el CLI de dotnet para instalar dependencias desde el registro de paquetes de NuGet antes de compilar y probar tu código. Por ejemplo, el siguiente YAML instala el paquete `Newtonsoft`.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
uses: {% data reusables.actions.action-setup-dotnet %}
|
||||
with:
|
||||
dotnet-version: '3.1.x'
|
||||
- name: Install dependencies
|
||||
run: dotnet add package Newtonsoft.Json --version 12.0.1
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
|
||||
@@ -138,25 +128,23 @@ Puedes guardar dependencias de NuGet en el caché utilizando una clave única, l
|
||||
|
||||
Para obtener más información, consulta la sección "[Almacenar las dependencias en caché para agilizar los flujos de trabajo](/actions/guides/caching-dependencies-to-speed-up-workflows)".
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
uses: {% data reusables.actions.action-setup-dotnet %}
|
||||
with:
|
||||
dotnet-version: '3.1.x'
|
||||
- uses: actions/cache@v2
|
||||
- uses: {% data reusables.actions.action-cache %}
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
# Look to see if there is a cache hit for the corresponding requirements file
|
||||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||
key: {% raw %}${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-nuget
|
||||
${{ runner.os }}-nuget{% endraw %}
|
||||
- name: Install dependencies
|
||||
run: dotnet add package Newtonsoft.Json --version 12.0.1
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
{% note %}
|
||||
|
||||
@@ -170,12 +158,11 @@ steps:
|
||||
|
||||
Puedes usar los mismos comandos que usas de forma local para construir y probar tu código. Este ejemplo demuestra cómo utilizar `dotnet build` y `dotnet test` en un job:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
uses: {% data reusables.actions.action-setup-dotnet %}
|
||||
with:
|
||||
dotnet-version: '3.1.x'
|
||||
- name: Install dependencies
|
||||
@@ -185,7 +172,6 @@ steps:
|
||||
- name: Test with the dotnet CLI
|
||||
run: dotnet test
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Empaquetar datos de flujo de trabajo como artefactos
|
||||
|
||||
@@ -193,7 +179,7 @@ Después de que se completa un flujo de trabajo, puedes cargar los artefactos qu
|
||||
|
||||
Para obtener más información, consulta "[Conservar datos de flujo de trabajo mediante artefactos](/github/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts)".
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
name: dotnet package
|
||||
|
||||
@@ -208,24 +194,23 @@ jobs:
|
||||
dotnet-version: [ '3.0', '3.1.x', '5.0.x' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v1
|
||||
uses: {% data reusables.actions.action-setup-dotnet %}
|
||||
with:
|
||||
dotnet-version: ${{ matrix.dotnet-version }}
|
||||
dotnet-version: {% raw %}${{ matrix.dotnet-version }}{% endraw %}
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Test with dotnet
|
||||
run: dotnet test --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
|
||||
run: dotnet test --logger trx --results-directory {% raw %}"TestResults-${{ matrix.dotnet-version }}"{% endraw %}
|
||||
- name: Upload dotnet test results
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: dotnet-results-${{ matrix.dotnet-version }}
|
||||
path: TestResults-${{ matrix.dotnet-version }}
|
||||
name: {% raw %}dotnet-results-${{ matrix.dotnet-version }}{% endraw %}
|
||||
path: {% raw %}TestResults-${{ matrix.dotnet-version }}{% endraw %}
|
||||
# Use always() to always run this step to publish test results when there are test failures
|
||||
if: ${{ always() }}
|
||||
if: {% raw %}${{ always() }}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Publicar en registros de paquetes
|
||||
|
||||
@@ -245,8 +230,8 @@ jobs:
|
||||
packages: write
|
||||
contents: read{% endif %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-dotnet@v1
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-dotnet %}
|
||||
with:
|
||||
dotnet-version: '3.1.x' # SDK Version to use.
|
||||
source-url: https://nuget.pkg.github.com/<owner>/index.json
|
||||
|
||||
@@ -42,7 +42,6 @@ Te recomendamos que tengas una comprensión básica de Node.js, YAML, las opcion
|
||||
|
||||
Para comenzar rápidamente, agrega el flujo de trabajo inicial al directorio de `.github/workflows` de tu repositorio. El flujo de trabajo que se muestra a continuación asume que la rama predeterminada de tu repositorio es `main`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Node.js CI
|
||||
|
||||
@@ -62,16 +61,15 @@ jobs:
|
||||
node-version: [10.x, 12.x, 14.x, 15.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js {% raw %}${{ matrix.node-version }}{% endraw %}
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-version: {% raw %}${{ matrix.node-version }}{% endraw %}
|
||||
- run: npm ci
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
{% data reusables.actions.example-github-runner %}
|
||||
|
||||
@@ -85,20 +83,18 @@ El flujo de trabajo inicial incluye una estrategia de matriz que compila y prueb
|
||||
|
||||
Cada trabajo puede acceder al valor definido en la matriz `node-version` por medio del contexto `matrix`. La acción `setup-node` utiliza el contexto como la entrada `node-version`. La acción `setup-node` configura cada trabajo con una versión diferente de Node.js antes de construir y probar código. Para obtener más información acerca de las estrategias y los contextos de la matriz, consulta las secciones "[Sintaxis de flujo de trabajo para las {% data variables.product.prodname_actions %}](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix)" y "[Contextos](/actions/learn-github-actions/contexts)".
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x, 12.x, 14.x, 15.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js {% raw %}${{ matrix.node-version }}{% endraw %}
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-version: {% raw %}${{ matrix.node-version }}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Como alternativa, puedes construir y probar con las versiones exactas de Node.js.
|
||||
|
||||
@@ -110,7 +106,6 @@ strategy:
|
||||
|
||||
O bien, puedes construir y probar mediante una versión única de Node.js.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Node.js CI
|
||||
|
||||
@@ -122,16 +117,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- run: npm ci
|
||||
- run: npm run build --if-present
|
||||
- run: npm test
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Si no especificas una versión de Node.js, {% data variables.product.prodname_dotcom %} utiliza la versión de Node.js por defecto del entorno.
|
||||
{% ifversion ghae %} {% data reusables.actions.self-hosted-runners-software %}
|
||||
@@ -150,9 +144,9 @@ Este ejemplo instala las dependencias definidas en el archivo *package.json*. Pa
|
||||
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- name: Install dependencies
|
||||
@@ -161,18 +155,16 @@ steps:
|
||||
|
||||
Mediante `npm ci` se instalan las versiones en el archivo *package-lock.json* o *npm-shrinkwrap.json* y se evitan las actualizaciones al archivo de bloqueo. Usar `npm ci` generalmente es más rápido que ejecutar `npm install`. Para obtener más información, consulta [`npm ci`](https://docs.npmjs.com/cli/ci.html) e [Introducir `npm ci` para construcciones más rápidas y confiables](https://blog.npmjs.org/post/171556855892/introducing-npm-ci-for-faster-more-reliable)."
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Ejemplo con Yarn
|
||||
|
||||
@@ -180,22 +172,22 @@ Este ejemplo instala las dependencias definidas en el archivo *package.json*. Pa
|
||||
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
```
|
||||
|
||||
De forma alternativa, puede pasar `--frozen-lockfile` para instalar las versiones en el archivo `yarn.lock` y evitar actualizaciones al archivo `yarn.lock`.
|
||||
Alternatively, you can pass `--frozen-lockfile` to install the versions in the `yarn.lock` file and prevent updates to the `yarn.lock` file.
|
||||
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- name: Install dependencies
|
||||
@@ -212,12 +204,11 @@ En el siguiente ejemplo, el secreto `NPM_TOKEN` almacena el token de autenticaci
|
||||
|
||||
Antes de instalar dependencias, utiliza la acción `setup-node` para crear el archivo *.npmrc*. La acción tiene dos parámetros de entrada. El parámetro `node-version` establece la versión de Node.js y el parámetro `registry-url` establece el registro predeterminado. Si tu registro de paquetes usa ámbitos, debes usar el parámetro `scope`. Para obtener más información, consulta [`npm-scope`](https://docs.npmjs.com/misc/scope).
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
always-auth: true
|
||||
node-version: '12.x'
|
||||
@@ -226,9 +217,8 @@ steps:
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
NODE_AUTH_TOKEN: {% raw %}${{ secrets.NPM_TOKEN }}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
El ejemplo anterior crea un archivo *.npmrc* con el siguiente contenido:
|
||||
|
||||
@@ -243,10 +233,11 @@ always-auth=true
|
||||
Cuando utilices ejecutores hospedados en {% data variables.product.prodname_dotcom %}, puedes guardarlos en caché y restablecer las dependencias utilizando la [acción `setup-node`](https://github.com/actions/setup-node).
|
||||
|
||||
El siguiente ejemplo guarda las dependencias en caché para npm.
|
||||
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '14'
|
||||
cache: 'npm'
|
||||
@@ -258,8 +249,8 @@ El siguiente ejemplo guarda las dependencias en caché para Yarn.
|
||||
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '14'
|
||||
cache: 'yarn'
|
||||
@@ -275,11 +266,11 @@ El siguiente ejemplo guarda las dependencias en caché para pnpm (v6.10+).
|
||||
# NOTE: pnpm caching support requires pnpm version >= 6.10.0
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
|
||||
with:
|
||||
version: 6.10.0
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '14'
|
||||
cache: 'pnpm'
|
||||
@@ -295,9 +286,9 @@ Puedes usar los mismos comandos que usas de forma local para construir y probar
|
||||
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- run: npm install
|
||||
|
||||
@@ -47,7 +47,6 @@ To automate your testing with PowerShell and Pester, you can add a workflow that
|
||||
|
||||
This example workflow file must be added to your repository's `.github/workflows/` directory:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Test PowerShell on Ubuntu
|
||||
on: push
|
||||
@@ -58,7 +57,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Perform a Pester test from the command-line
|
||||
shell: pwsh
|
||||
run: Test-Path resultsfile.log | Should -Be $true
|
||||
@@ -67,7 +66,6 @@ jobs:
|
||||
run: |
|
||||
Invoke-Pester Unit.Tests.ps1 -Passthru
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
* `shell: pwsh` - Configures the job to use PowerShell when running the `run` commands.
|
||||
* `run: Test-Path resultsfile.log` - Check whether a file called `resultsfile.log` is present in the repository's root directory.
|
||||
@@ -110,21 +108,19 @@ When using {% data variables.product.prodname_dotcom %}-hosted runners, you can
|
||||
|
||||
For example, the following job installs the `SqlServer` and `PSScriptAnalyzer` modules:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
install-dependencies:
|
||||
name: Install dependencies
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Install from PSGallery
|
||||
shell: pwsh
|
||||
run: |
|
||||
Set-PSRepository PSGallery -InstallationPolicy Trusted
|
||||
Install-Module SqlServer, PSScriptAnalyzer
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
{% note %}
|
||||
|
||||
@@ -138,16 +134,15 @@ When using {% data variables.product.prodname_dotcom %}-hosted runners, you can
|
||||
|
||||
PowerShell caches its dependencies in different locations, depending on the runner's operating system. For example, the `path` location used in the following Ubuntu example will be different for a Windows operating system.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Setup PowerShell module cache
|
||||
id: cacher
|
||||
uses: actions/cache@v2
|
||||
uses: {% data reusables.actions.action-cache %}
|
||||
with:
|
||||
path: "~/.local/share/powershell/Modules"
|
||||
key: ${{ runner.os }}-SqlServer-PSScriptAnalyzer
|
||||
key: {% raw %}${{ runner.os }}-SqlServer-PSScriptAnalyzer{% endraw %}
|
||||
- name: Install required PowerShell modules
|
||||
if: steps.cacher.outputs.cache-hit != 'true'
|
||||
shell: pwsh
|
||||
@@ -155,7 +150,6 @@ steps:
|
||||
Set-PSRepository PSGallery -InstallationPolicy Trusted
|
||||
Install-Module SqlServer, PSScriptAnalyzer -ErrorAction Stop
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Testing your code
|
||||
|
||||
@@ -165,13 +159,12 @@ You can use the same commands that you use locally to build and test your code.
|
||||
|
||||
The following example installs `PSScriptAnalyzer` and uses it to lint all `ps1` files in the repository. For more information, see [PSScriptAnalyzer on GitHub](https://github.com/PowerShell/PSScriptAnalyzer).
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
lint-with-PSScriptAnalyzer:
|
||||
name: Install and run PSScriptAnalyzer
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Install PSScriptAnalyzer module
|
||||
shell: pwsh
|
||||
run: |
|
||||
@@ -189,7 +182,6 @@ The following example installs `PSScriptAnalyzer` and uses it to lint all `ps1`
|
||||
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total."
|
||||
}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Packaging workflow data as artifacts
|
||||
|
||||
@@ -197,7 +189,6 @@ You can upload artifacts to view after a workflow completes. For example, you ma
|
||||
|
||||
The following example demonstrates how you can use the `upload-artifact` action to archive the test results received from `Invoke-Pester`. For more information, see the [`upload-artifact` action](https://github.com/actions/upload-artifact).
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Upload artifact from Ubuntu
|
||||
|
||||
@@ -208,18 +199,17 @@ jobs:
|
||||
name: Run Pester and upload results
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Test with Pester
|
||||
shell: pwsh
|
||||
run: Invoke-Pester Unit.Tests.ps1 -Passthru | Export-CliXml -Path Unit.Tests.xml
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: ubuntu-Unit-Tests
|
||||
path: Unit.Tests.xml
|
||||
if: ${{ always() }}
|
||||
if: {% raw %}${{ always() }}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
The `always()` function configures the job to continue processing even if there are test failures. For more information, see "[always](/actions/reference/context-and-expression-syntax-for-github-actions#always)."
|
||||
|
||||
@@ -229,7 +219,6 @@ You can configure your workflow to publish your PowerShell module to the PowerSh
|
||||
|
||||
The following example creates a package and uses `Publish-Module` to publish it to the PowerShell Gallery:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Publish PowerShell Module
|
||||
|
||||
@@ -241,13 +230,12 @@ jobs:
|
||||
publish-to-gallery:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Build and publish
|
||||
env:
|
||||
NUGET_KEY: ${{ secrets.NUGET_KEY }}
|
||||
NUGET_KEY: {% raw %}${{ secrets.NUGET_KEY }}{% endraw %}
|
||||
shell: pwsh
|
||||
run: |
|
||||
./build.ps1 -Path /tmp/samplemodule
|
||||
Publish-Module -Path /tmp/samplemodule -NuGetApiKey $env:NUGET_KEY -Verbose
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
@@ -48,7 +48,6 @@ We recommend that you have a basic understanding of Python, PyPy, and pip. For m
|
||||
|
||||
To get started quickly, add the starter workflow to the `.github/workflows` directory of your repository.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Python package
|
||||
|
||||
@@ -63,11 +62,11 @@ jobs:
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Python {% raw %}${{ matrix.python-version }}{% endraw %}
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
python-version: {% raw %}${{ matrix.python-version }}{% endraw %}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
@@ -83,7 +82,6 @@ jobs:
|
||||
run: |
|
||||
pytest
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Specifying a Python version
|
||||
|
||||
@@ -105,7 +103,6 @@ If you are using a self-hosted runner, you can configure the runner to use the `
|
||||
|
||||
### Using multiple Python versions
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Python package
|
||||
|
||||
@@ -117,27 +114,25 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
# You can use PyPy versions in python-version.
|
||||
# For example, pypy2 and pypy3
|
||||
# For example, {% if actions-node16-action %}pypy-2.7 and pypy-3.8{% else %}pypy2 and pypy3{% endif %}
|
||||
matrix:
|
||||
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Python {% raw %}${{ matrix.python-version }}{% endraw %}
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
python-version: {% raw %}${{ matrix.python-version }}{% endraw %}
|
||||
# You can test your matrix by printing the current Python version
|
||||
- name: Display Python version
|
||||
run: python -c "import sys; print(sys.version)"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Using a specific Python version
|
||||
|
||||
You can configure a specific version of python. For example, 3.8. Alternatively, you can use semantic version syntax to get the latest minor release. This example uses the latest minor release of Python 3.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Python package
|
||||
|
||||
@@ -149,9 +144,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Python 3.x
|
||||
uses: actions/setup-python@v2
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
# Semantic version range syntax or exact version of a Python version
|
||||
python-version: '3.x'
|
||||
@@ -161,7 +156,6 @@ jobs:
|
||||
- name: Display Python version
|
||||
run: python -c "import sys; print(sys.version)"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Excluding a version
|
||||
|
||||
@@ -169,7 +163,6 @@ If you specify a version of Python that is not available, `setup-python` fails w
|
||||
|
||||
You can also use the `exclude` keyword in your workflow if there is a configuration of Python that you do not wish to run. For more information, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategy)."
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Python package
|
||||
|
||||
@@ -178,18 +171,17 @@ on: [push]
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
runs-on: {% raw %}${{ matrix.os }}{% endraw %}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9", pypy2, pypy3]
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9", {% if actions-node16-action %}pypy-2.7, pypy-3.8{% else %}pypy2, pypy3{% endif %}]
|
||||
exclude:
|
||||
- os: macos-latest
|
||||
python-version: "3.6"
|
||||
- os: windows-latest
|
||||
python-version: "3.6"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Using the default Python version
|
||||
|
||||
@@ -207,29 +199,26 @@ We recommend using `setup-python` to configure the version of Python used in you
|
||||
|
||||
When using {% data variables.product.prodname_dotcom %}-hosted runners, you can also cache dependencies to speed up your workflow. For more information, see "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Caching dependencies to speed up workflows</a>."
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: python -m pip install --upgrade pip setuptools wheel
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Requirements file
|
||||
|
||||
After you update `pip`, a typical next step is to install dependencies from *requirements.txt*. For more information, see [pip](https://pip.pypa.io/en/stable/cli/pip_install/#example-requirements-file).
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
@@ -237,7 +226,6 @@ steps:
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Caching Dependencies
|
||||
|
||||
@@ -247,8 +235,8 @@ The following example caches dependencies for pip.
|
||||
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: '3.9'
|
||||
cache: 'pip'
|
||||
@@ -268,12 +256,11 @@ You can use the same commands that you use locally to build and test your code.
|
||||
|
||||
This example installs or upgrades `pytest` and `pytest-cov`. Tests are then run and output in JUnit format while code coverage results are output in Cobertura. For more information, see [JUnit](https://junit.org/junit5/) and [Cobertura](https://cobertura.github.io/cobertura/).
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
@@ -286,18 +273,16 @@ steps:
|
||||
pip install pytest-cov
|
||||
pytest tests.py --doctest-modules --junitxml=junit/test-results.xml --cov=com --cov-report=xml --cov-report=html
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Using Flake8 to lint code
|
||||
|
||||
The following example installs or upgrades `flake8` and uses it to lint all files. For more information, see [Flake8](http://flake8.pycqa.org/en/latest/).
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
@@ -310,7 +295,6 @@ steps:
|
||||
flake8 .
|
||||
continue-on-error: true
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
The linting step has `continue-on-error: true` set. This will keep the workflow from failing if the linting step doesn't succeed. Once you've addressed all of the linting errors, you can remove this option so the workflow will catch new issues.
|
||||
|
||||
@@ -318,7 +302,6 @@ The linting step has `continue-on-error: true` set. This will keep the workflow
|
||||
|
||||
With {% data variables.product.prodname_actions %}, you can run tests with tox and spread the work across multiple jobs. You'll need to invoke tox using the `-e py` option to choose the version of Python in your `PATH`, rather than specifying a specific version. For more information, see [tox](https://tox.readthedocs.io/en/latest/).
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Python package
|
||||
|
||||
@@ -333,18 +316,17 @@ jobs:
|
||||
python: ["3.7", "3.8", "3.9"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
python-version: {% raw %}${{ matrix.python }}{% endraw %}
|
||||
- name: Install tox and any other packages
|
||||
run: pip install tox
|
||||
- name: Run tox
|
||||
# Run tox using the version of Python in `PATH`
|
||||
run: tox -e py
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Packaging workflow data as artifacts
|
||||
|
||||
@@ -352,7 +334,6 @@ You can upload artifacts to view after a workflow completes. For example, you ma
|
||||
|
||||
The following example demonstrates how you can use the `upload-artifact` action to archive test results from running `pytest`. For more information, see the [`upload-artifact` action](https://github.com/actions/upload-artifact).
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Python package
|
||||
|
||||
@@ -367,27 +348,26 @@ jobs:
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Setup Python # Set Python version
|
||||
uses: actions/setup-python@v2
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
python-version: {% raw %}${{ matrix.python-version }}{% endraw %}
|
||||
# Install pip and pytest
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest
|
||||
- name: Test with pytest
|
||||
run: pytest tests.py --doctest-modules --junitxml=junit/test-results-${{ matrix.python-version }}.xml
|
||||
run: pytest tests.py --doctest-modules {% raw %}--junitxml=junit/test-results-${{ matrix.python-version }}.xml{% endraw %}
|
||||
- name: Upload pytest test results
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: pytest-results-${{ matrix.python-version }}
|
||||
path: junit/test-results-${{ matrix.python-version }}.xml
|
||||
name: {% raw %}pytest-results-${{ matrix.python-version }}{% endraw %}
|
||||
path: {% raw %}junit/test-results-${{ matrix.python-version }}.xml{% endraw %}
|
||||
# Use always() to always run this step to publish test results when there are test failures
|
||||
if: ${{ always() }}
|
||||
if: {% raw %}${{ always() }}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Publishing to package registries
|
||||
|
||||
@@ -408,9 +388,9 @@ jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
|
||||
with:
|
||||
@@ -71,17 +71,15 @@ La forma en la que se recomienda utilizar Ruby con GitHub Actions es mediante la
|
||||
|
||||
La acción `setup-ruby` toma una versión de Ruby como entrada y la configura en el ejecutor.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
|
||||
with:
|
||||
ruby-version: '3.1' # Not needed with a .ruby-version file
|
||||
- run: bundle install
|
||||
- run: bundle exec rake
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Como alternativa, puedes ingresar un archivo de `.ruby-version` en la raíz de tu repositorio y `setup-ruby` utilizará la versión que se defina en dicho archivo.
|
||||
|
||||
@@ -122,7 +120,7 @@ jobs:
|
||||
ruby-version: ['3.1', '3.0', '2.7']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: {% raw %}Set up Ruby ${{ matrix.ruby-version }}{% endraw %}
|
||||
uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
|
||||
with:
|
||||
@@ -137,16 +135,14 @@ jobs:
|
||||
|
||||
La acción `setup-ruby` te instalará bundler automáticamente. La versión se determina de acuerdo con tu archivo `gemfile.lock`. Si no hay alguna versión presente en tu archivo de bloqueo, entonces se instalará la última versión compatible.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
|
||||
with:
|
||||
ruby-version: '3.1'
|
||||
- run: bundle install
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Almacenar dependencias en caché
|
||||
|
||||
@@ -169,39 +165,35 @@ Esto configurará a bundler para que instale tus gemas en `vendor/cache`. Para c
|
||||
|
||||
Para tener un mejor control sobre el guardado en caché, si estás utilizando ejecutores hospedados en {% data variables.product.prodname_dotcom %}, puedes utilizar la acción `actions/cache` directamente. Para obtener más información, consulta la sección "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Almacenar las dependencias en caché para agilizar los flujos de trabajo</a>".
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/cache@v2
|
||||
- uses: {% data reusables.actions.action-cache %}
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
||||
key: {% raw %}${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}{% endraw %}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gems-
|
||||
{% raw %}${{ runner.os }}-gems-{% endraw %}
|
||||
- name: Bundle install
|
||||
run: |
|
||||
bundle config path vendor/bundle
|
||||
bundle install --jobs 4 --retry 3
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Si estás utilizando una compilación de matriz, deberás incluir las variables de dicha matriz en tu clave de caché. Por ejemplo, si tienes una estrategia de matriz para versiones de Ruby diferentes (`matrix.ruby-version`) y sistemas operativos diferentes (`matrix.os`), tus pasos de flujo de trabajo podrían verse así:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/cache@v2
|
||||
- uses: {% data reusables.actions.action-cache %}
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}
|
||||
key: {% raw %}bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ hashFiles('**/Gemfile.lock') }}{% endraw %}
|
||||
restore-keys: |
|
||||
bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-
|
||||
{% raw %}bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-{% endraw %}
|
||||
- name: Bundle install
|
||||
run: |
|
||||
bundle config path vendor/bundle
|
||||
bundle install --jobs 4 --retry 3
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Probar tu código en matrices
|
||||
|
||||
@@ -228,7 +220,7 @@ jobs:
|
||||
ruby: [2.5, 2.6, 2.7, head, debug, jruby, jruby-head, truffleruby, truffleruby-head]
|
||||
continue-on-error: {% raw %}${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}{% endraw %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
|
||||
with:
|
||||
ruby-version: {% raw %}${{ matrix.ruby }}{% endraw %}
|
||||
@@ -251,7 +243,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
@@ -288,8 +280,8 @@ jobs:
|
||||
packages: write
|
||||
contents: read{% endif %}
|
||||
|
||||
steps:{% raw %}
|
||||
- uses: actions/checkout@v2
|
||||
steps:
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Ruby 2.6
|
||||
uses: ruby/setup-ruby@477b21f02be01bcb8030d50f37cfec92bfa615b6
|
||||
with:
|
||||
@@ -297,7 +289,7 @@ jobs:
|
||||
- run: bundle install
|
||||
|
||||
- name: Publish to GPR
|
||||
run: |
|
||||
run: |{% raw %}
|
||||
mkdir -p $HOME/.gem
|
||||
touch $HOME/.gem/credentials
|
||||
chmod 0600 $HOME/.gem/credentials
|
||||
|
||||
@@ -37,7 +37,6 @@ Te recomendamos que tengas un entendimiento básico de los paquetes de Swift. Pa
|
||||
|
||||
Para comenzar rápidamente, agrega el flujo de trabajo inicial al directorio de `.github/workflows` de tu repositorio.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Swift
|
||||
|
||||
@@ -49,13 +48,12 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Build
|
||||
run: swift build
|
||||
- name: Run tests
|
||||
run: swift test
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Especificar una versión de Swift
|
||||
|
||||
@@ -88,7 +86,7 @@ jobs:
|
||||
- uses: fwal/setup-swift@2040b795e5c453c3a05fcb8316496afc8a74f192
|
||||
with:
|
||||
swift-version: {% raw %}${{ matrix.swift }}{% endraw %}
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Build
|
||||
run: swift build
|
||||
- name: Run tests
|
||||
@@ -114,10 +112,9 @@ steps:
|
||||
|
||||
Puedes utilizar los mismos comandos que usas localmente para compilar y probar tu código utilizando Swift. Este ejemplo demuestra cómo utilizar `swift build` y `swift test` en un job:
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: fwal/setup-swift@2040b795e5c453c3a05fcb8316496afc8a74f192
|
||||
with:
|
||||
swift-version: "5.3.3"
|
||||
@@ -126,4 +123,3 @@ steps:
|
||||
- name: Run tests
|
||||
run: swift test
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
@@ -45,7 +45,6 @@ Te recomendamos tener un entendimiento básico de Xamarin, .NET Core SDK, Yaml,
|
||||
|
||||
El ejemplo siguiente demuestra cómo cambiar las versiones predeterminadas de Xamarin SDK y cómo compilar una aplicación de Xamarin.iOS.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Build Xamarin.iOS app
|
||||
|
||||
@@ -57,7 +56,7 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set default Xamarin SDK versions
|
||||
run: |
|
||||
$VM_ASSETS/select-xamarin-sdk-v2.sh --mono=6.12 --ios=14.10
|
||||
@@ -69,7 +68,7 @@ jobs:
|
||||
sudo xcode-select -s $XCODE_ROOT
|
||||
|
||||
- name: Setup .NET Core SDK 5.0.x
|
||||
uses: actions/setup-dotnet@v1
|
||||
uses: {% data reusables.actions.action-setup-dotnet %}
|
||||
with:
|
||||
dotnet-version: '5.0.x'
|
||||
|
||||
@@ -79,13 +78,11 @@ jobs:
|
||||
- name: Build
|
||||
run: msbuild <csproj_file_path> /p:Configuration=Debug /p:Platform=iPhoneSimulator /t:Rebuild
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Crear apps de Xamarin.Android
|
||||
|
||||
El ejemplo siguiente demuestra cómo cambiar las versiones predeterminadas de Xamarin SDK y cómo compilar una aplicación de Xamarin.Android.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Build Xamarin.Android app
|
||||
|
||||
@@ -97,13 +94,13 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set default Xamarin SDK versions
|
||||
run: |
|
||||
$VM_ASSETS/select-xamarin-sdk-v2.sh --mono=6.10 --android=10.2
|
||||
|
||||
- name: Setup .NET Core SDK 5.0.x
|
||||
uses: actions/setup-dotnet@v1
|
||||
uses: {% data reusables.actions.action-setup-dotnet %}
|
||||
with:
|
||||
dotnet-version: '5.0.x'
|
||||
|
||||
@@ -113,7 +110,6 @@ jobs:
|
||||
- name: Build
|
||||
run: msbuild <csproj_file_path> /t:PackageForAndroid /p:Configuration=Debug
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Especificar una versión de .NET
|
||||
|
||||
|
||||
@@ -117,7 +117,6 @@ El siguiente código de flujo de trabajo utiliza la acción completada de "hello
|
||||
|
||||
Copia el código del flujo de trabajo en un archivo de `.github/workflows/main.yml` en otro repositorio, pero reemplaza `actions/hello-world-composite-action@v1` con el repositorio y etiqueta que creaste. También puedes reemplazar la entrada `who-to-greet` con tu nombre.
|
||||
|
||||
{% raw %}
|
||||
**.github/workflows/main.yml**
|
||||
```yaml
|
||||
on: [push]
|
||||
@@ -127,14 +126,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
name: A job to say hello
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- id: foo
|
||||
uses: actions/hello-world-composite-action@v1
|
||||
with:
|
||||
who-to-greet: 'Mona the Octocat'
|
||||
- run: echo random-number ${{ steps.foo.outputs.random-number }}
|
||||
- run: echo random-number {% raw %}${{ steps.foo.outputs.random-number }}{% endraw %}
|
||||
shell: bash
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Desde tu repositorio, da clic en la pestaña de **Acciones** y selecciona la última ejecución de flujo de trabajo. La salida deberá incluir "Hello Mona the Octocat", el resultado del script de "Goodbye" y un número aleatorio.
|
||||
|
||||
@@ -212,7 +212,6 @@ jobs:
|
||||
|
||||
Copy the following example workflow code into a `.github/workflows/main.yml` file in your action's repository. You can also replace the `who-to-greet` input with your name. {% ifversion fpt or ghec %}This private action can't be published to {% data variables.product.prodname_marketplace %}, and can only be used in this repository.{% endif %}
|
||||
|
||||
{% raw %}
|
||||
**.github/workflows/main.yml**
|
||||
```yaml{:copy}
|
||||
on: [push]
|
||||
@@ -225,7 +224,7 @@ jobs:
|
||||
# To use this repository's private action,
|
||||
# you must check out the repository
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Hello world action step
|
||||
uses: ./ # Uses an action in the root directory
|
||||
id: hello
|
||||
@@ -233,9 +232,8 @@ jobs:
|
||||
who-to-greet: 'Mona the Octocat'
|
||||
# Use the output from the `hello` step
|
||||
- name: Get the output time
|
||||
run: echo "The time was ${{ steps.hello.outputs.time }}"
|
||||
run: echo "The time was {% raw %}${{ steps.hello.outputs.time }}"{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
From your repository, click the **Actions** tab, and select the latest workflow run. Under **Jobs** or in the visualization graph, click **A job to say hello**. You should see "Hello Mona the Octocat" or the name you used for the `who-to-greet` input and the timestamp printed in the log.
|
||||
|
||||
|
||||
@@ -238,7 +238,6 @@ Cuando se activa este flujo de trabajo, el ejecutor descargará la acción `hell
|
||||
|
||||
Copia el siguiente ejemplo de código de flujo de trabajo en un archivo `.github/workflows/main.yml` en tu repositorio de acción. También puedes reemplazar la entrada `who-to-greet` con tu nombre.
|
||||
|
||||
{% raw %}
|
||||
**.github/workflows/main.yml**
|
||||
```yaml{:copy}
|
||||
on: [push]
|
||||
@@ -251,7 +250,7 @@ jobs:
|
||||
# To use this repository's private action,
|
||||
# you must check out the repository
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Hello world action step
|
||||
uses: ./ # Uses an action in the root directory
|
||||
id: hello
|
||||
@@ -259,9 +258,8 @@ jobs:
|
||||
who-to-greet: 'Mona the Octocat'
|
||||
# Use the output from the `hello` step
|
||||
- name: Get the output time
|
||||
run: echo "The time was ${{ steps.hello.outputs.time }}"
|
||||
run: echo "The time was {% raw %}${{ steps.hello.outputs.time }}{% endraw %}"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Desde tu repositorio, da clic en la pestaña de **Acciones** y selecciona la última ejecución de flujo de trabajo. Debajo de **Jobs** o en la gráfica de visualización, haz clic en **A job to say hello**. Deberías ver "Hello Mona the Octocat" o el nombre que usaste para la entrada `who-to-greet` y la marcación de hora impresa en el registro.
|
||||
|
||||
|
||||
@@ -333,9 +333,9 @@ runs:
|
||||
# Reference a specific commit
|
||||
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
# Reference the major version of a release
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
# Reference a specific version
|
||||
- uses: actions/checkout@v2.2.0
|
||||
- uses: {% data reusables.actions.action-checkout %}.2.0
|
||||
# Reference a branch
|
||||
- uses: actions/checkout@main
|
||||
# References a subdirectory in a public GitHub repository at a specific branch, ref, or SHA
|
||||
|
||||
@@ -115,11 +115,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
environment: production
|
||||
|
||||
{% raw %}steps:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Configure AWS credentials
|
||||
{% raw %}- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@13d241b293754004c80624b5567555c4a39ffbe3
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
@@ -83,10 +83,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Set up Java version
|
||||
uses: actions/setup-java@v2.3.1
|
||||
uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: {% raw %}${{ env.JAVA_VERSION }}{% endraw %}
|
||||
cache: 'maven'
|
||||
@@ -95,7 +95,7 @@ jobs:
|
||||
run: mvn clean install
|
||||
|
||||
- name: Upload artifact for deployment job
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: java-app
|
||||
path: '{% raw %}${{ github.workspace }}{% endraw %}/target/*.jar'
|
||||
@@ -109,7 +109,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v3
|
||||
uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: java-app
|
||||
|
||||
|
||||
@@ -83,15 +83,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Set up .NET Core
|
||||
uses: actions/setup-dotnet@v1
|
||||
uses: {% data reusables.actions.action-setup-dotnet %}
|
||||
with:
|
||||
dotnet-version: {% raw %}${{ env.DOTNET_VERSION }}{% endraw %}
|
||||
|
||||
- name: Set up dependency caching for faster builds
|
||||
uses: actions/cache@v2
|
||||
uses: {% data reusables.actions.action-cache %}
|
||||
with:
|
||||
path: ~/.nuget/packages
|
||||
key: {% raw %}${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}{% endraw %}
|
||||
@@ -105,7 +105,7 @@ jobs:
|
||||
run: dotnet publish -c Release -o {% raw %}${{env.DOTNET_ROOT}}{% endraw %}/myapp
|
||||
|
||||
- name: Upload artifact for deployment job
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: .net-app
|
||||
path: {% raw %}${{env.DOTNET_ROOT}}{% endraw %}/myapp
|
||||
@@ -119,7 +119,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v3
|
||||
uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: .net-app
|
||||
|
||||
|
||||
@@ -86,10 +86,10 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: {% raw %}${{ env.NODE_VERSION }}{% endraw %}
|
||||
cache: 'npm'
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
npm run build --if-present
|
||||
npm run test --if-present
|
||||
- name: Upload artifact for deployment job
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: node-app
|
||||
path: .
|
||||
@@ -114,7 +114,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v3
|
||||
uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: node-app
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
@@ -103,7 +103,7 @@ jobs:
|
||||
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||
|
||||
- name: Set up dependency caching for faster installs
|
||||
uses: actions/cache@v2
|
||||
uses: {% data reusables.actions.action-cache %}
|
||||
if: steps.check_files.outputs.files_exists == 'true'
|
||||
with:
|
||||
path: {% raw %}${{ steps.composer-cache.outputs.dir }}{% endraw %}
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
run: composer validate --no-check-publish && composer install --prefer-dist --no-progress
|
||||
|
||||
- name: Upload artifact for deployment job
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: php-app
|
||||
path: .
|
||||
@@ -130,7 +130,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v3
|
||||
uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: php-app
|
||||
|
||||
|
||||
@@ -85,10 +85,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Set up Python version
|
||||
uses: actions/setup-python@v2.2.2
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: {% raw %}${{ env.PYTHON_VERSION }}{% endraw %}
|
||||
|
||||
@@ -98,7 +98,7 @@ jobs:
|
||||
source venv/bin/activate
|
||||
|
||||
- name: Set up dependency caching for faster installs
|
||||
uses: actions/cache@v2
|
||||
uses: {% data reusables.actions.action-cache %}
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: {% raw %}${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}{% endraw %}
|
||||
@@ -111,11 +111,11 @@ jobs:
|
||||
# Optional: Add a step to run tests here (PyTest, Django test suites, etc.)
|
||||
|
||||
- name: Upload artifact for deployment jobs
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: python-app
|
||||
path: |
|
||||
.
|
||||
.
|
||||
!venv/
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -126,7 +126,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Download artifact from build job
|
||||
uses: actions/download-artifact@v3
|
||||
uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: python-app
|
||||
path: .
|
||||
|
||||
@@ -73,7 +73,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Azure Login
|
||||
uses: azure/login@89d153571fe9a34ed70fcf9f1d95ab8debea7a73
|
||||
|
||||
@@ -79,7 +79,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
name: Build and Deploy
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
with:
|
||||
submodules: true
|
||||
- name: Build And Deploy
|
||||
|
||||
@@ -159,7 +159,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
# Setup gcloud CLI
|
||||
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
|
||||
|
||||
@@ -74,7 +74,6 @@ Crea secretos en tu repositorio u organización para los siguientes elementos:
|
||||
|
||||
Este flujo de trabajo de ejemplo incluye un paso que importa el certificado de Apple y perfil de aprovisionamiento desde los secretos de {% data variables.product.prodname_dotcom %} y los instala en el ejecutor.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: App build
|
||||
on: push
|
||||
@@ -85,13 +84,13 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Install the Apple certificate and provisioning profile
|
||||
env:
|
||||
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
|
||||
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
|
||||
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
|
||||
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
||||
BUILD_CERTIFICATE_BASE64: {% raw %}${{ secrets.BUILD_CERTIFICATE_BASE64 }}{% endraw %}
|
||||
P12_PASSWORD: {% raw %}${{ secrets.P12_PASSWORD }}{% endraw %}
|
||||
BUILD_PROVISION_PROFILE_BASE64: {% raw %}${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}{% endraw %}
|
||||
KEYCHAIN_PASSWORD: {% raw %}${{ secrets.KEYCHAIN_PASSWORD }}{% endraw %}
|
||||
run: |
|
||||
# create variables
|
||||
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
|
||||
@@ -117,7 +116,6 @@ jobs:
|
||||
- name: Build app
|
||||
...
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Limpieza requerida en los ejecutores auto-hospedados
|
||||
|
||||
|
||||
@@ -79,13 +79,13 @@ env:
|
||||
# permission can be added at job level or workflow level
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: read # This is required for actions/checkout@v2
|
||||
contents: read # This is required for actions/checkout
|
||||
jobs:
|
||||
S3PackageUpload:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Git clone the repository
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: configure aws credentials
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
- name: Install OIDC Client from Core Package
|
||||
run: npm install @actions/core@1.6.0 @actions/http-client
|
||||
- name: Get Id Token
|
||||
uses: actions/github-script@v4
|
||||
uses: {% data reusables.actions.action-github-script %}
|
||||
id: idtoken
|
||||
with:
|
||||
script: |
|
||||
@@ -90,7 +90,7 @@ jobs:
|
||||
job:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v4
|
||||
- uses: {% data reusables.actions.action-github-script %}
|
||||
id: script
|
||||
timeout-minutes: 10
|
||||
with:
|
||||
|
||||
@@ -104,7 +104,6 @@ The following operating systems are supported for the self-hosted runner applica
|
||||
- Windows 8.1 64-bit
|
||||
- Windows 10 64-bit
|
||||
- Windows Server 2012 R2 64-bit
|
||||
- Windows Server 2016 64-bit
|
||||
- Windows Server 2019 64-bit
|
||||
|
||||
### macOS
|
||||
|
||||
@@ -272,7 +272,7 @@ jobs:
|
||||
normal_ci:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Run normal CI
|
||||
run: ./run-tests
|
||||
|
||||
@@ -280,7 +280,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
if: {% raw %}${{ github.event_name == 'pull_request' }}{% endraw %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Run PR CI
|
||||
run: ./run-additional-pr-ci
|
||||
```
|
||||
@@ -382,7 +382,6 @@ This example `job` context uses a PostgreSQL service container with mapped ports
|
||||
|
||||
This example workflow configures a PostgreSQL service container, and automatically maps port 5432 in the service container to a randomly chosen available port on the host. The `job` context is used to access the number of the port that was assigned on the host.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: PostgreSQL Service Example
|
||||
on: push
|
||||
@@ -400,11 +399,10 @@ jobs:
|
||||
- 5432
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: pg_isready -h localhost -p ${{ job.services.postgres.ports[5432] }}
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- run: pg_isready -h localhost -p {% raw %}${{ job.services.postgres.ports[5432] }}{% endraw %}
|
||||
- run: ./run-tests
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## `steps` context
|
||||
|
||||
@@ -443,7 +441,6 @@ This example `steps` context shows two previous steps that had an [`id`](/action
|
||||
|
||||
This example workflow generates a random number as an output in one step, and a later step uses the `steps` context to read the value of that output.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Generate random failure
|
||||
on: push
|
||||
@@ -452,15 +449,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- id: checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Generate 0 or 1
|
||||
id: generate_number
|
||||
run: echo "::set-output name=random_number::$(($RANDOM % 2))"
|
||||
- name: Pass or fail
|
||||
run: |
|
||||
if [[ ${{ steps.generate_number.outputs.random_number }} == 0 ]]; then exit 0; else exit 1; fi
|
||||
if [[ {% raw %}${{ steps.generate_number.outputs.random_number }}{% endraw %} == 0 ]]; then exit 0; else exit 1; fi
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## `runner` context
|
||||
|
||||
@@ -501,7 +497,6 @@ The following example context is from a Linux {% data variables.product.prodname
|
||||
|
||||
This example workflow uses the `runner` context to set the path to the temporary directory to write logs, and if the workflow fails, it uploads those logs as artifact.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Build
|
||||
on: push
|
||||
@@ -510,19 +505,18 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Build with logs
|
||||
run: |
|
||||
mkdir ${{ runner.temp }}/build_logs
|
||||
./build.sh --log-path ${{ runner.temp }}/build_logs
|
||||
mkdir {% raw %}${{ runner.temp }}{% endraw %}/build_logs
|
||||
./build.sh --log-path {% raw %}${{ runner.temp }}{% endraw %}/build_logs
|
||||
- name: Upload logs on fail
|
||||
if: ${{ failure() }}
|
||||
uses: actions/upload-artifact@v3
|
||||
if: {% raw %}${{ failure() }}{% endraw %}
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: Build failure logs
|
||||
path: ${{ runner.temp }}/build_logs
|
||||
path: {% raw %}${{ runner.temp }}{% endraw %}/build_logs
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## `secrets` context
|
||||
|
||||
@@ -583,7 +577,6 @@ The following example contents of the `strategy` context is from a build matrix
|
||||
|
||||
This example workflow uses the `strategy.job-index` property to set a unique name for a log file for each job in a build matrix.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Test matrix
|
||||
on: push
|
||||
@@ -596,15 +589,14 @@ jobs:
|
||||
test-group: [1, 2]
|
||||
node: [14, 16]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: npm test > test-job-${{ strategy.job-index }}.txt
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- run: npm test > test-job-{% raw %}${{ strategy.job-index }}{% endraw %}.txt
|
||||
- name: Upload logs
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: Build log for job ${{ strategy.job-index }}
|
||||
path: test-job-${{ strategy.job-index }}.txt
|
||||
name: Build log for job {% raw %}${{ strategy.job-index }}{% endraw %}
|
||||
path: test-job-{% raw %}${{ strategy.job-index }}{% endraw %}.txt
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## `matrix` context
|
||||
|
||||
@@ -632,29 +624,27 @@ The following example contents of the `matrix` context is from a job in a build
|
||||
|
||||
This example workflow creates a build matrix with `os` and `node` keys. It uses the `matrix.os` property to set the runner type for each job, and uses the `matrix.node` property to set the Node.js version for each job.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Test matrix
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
runs-on: {% raw %}${{ matrix.os }}{% endraw %}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
node: [14, 16]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
node-version: {% raw %}${{ matrix.node }}{% endraw %}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## `needs` context
|
||||
|
||||
@@ -691,7 +681,6 @@ The following example contents of the `needs` context shows information for two
|
||||
|
||||
This example workflow has three jobs: a `build` job that does a build, a `deploy` job that requires the `build` job, and a `debug` job that requires both the `build` and `deploy` jobs and runs only if there is a failure in the workflow. The `deploy` job also uses the `needs` context to access an output from the `build` job.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Build and deploy
|
||||
on: push
|
||||
@@ -700,9 +689,9 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
build_id: ${{ steps.build_step.outputs.build_id }}
|
||||
build_id: {% raw %}${{ steps.build_step.outputs.build_id }}{% endraw %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Build
|
||||
id: build_step
|
||||
run: |
|
||||
@@ -712,17 +701,16 @@ jobs:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: ./deploy --build ${{ needs.build.outputs.build_id }}
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- run: ./deploy --build {% raw %}${{ needs.build.outputs.build_id }}{% endraw %}
|
||||
debug:
|
||||
needs: [build, deploy]
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ failure() }}
|
||||
if: {% raw %}${{ failure() }}{% endraw %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- run: ./debug
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-4757 %}
|
||||
## `inputs` context
|
||||
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
run: |
|
||||
expr 1 + 1 > output.log
|
||||
- name: Upload output file
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: output-log-file
|
||||
path: output.log
|
||||
@@ -88,7 +88,7 @@ jobs:
|
||||
example-job:
|
||||
steps:
|
||||
- name: Download a single artifact
|
||||
uses: actions/download-artifact@v3
|
||||
uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: output-log-file
|
||||
```
|
||||
|
||||
@@ -96,8 +96,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Este paso revisa una copia de tu repositorio.
|
||||
- uses: actions/checkout@v2
|
||||
# Este paso hace referencia al directorio que contiene la acción.
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
# This step references the directory that contains the action.
|
||||
- uses: ./.github/actions/hello-world-action
|
||||
```
|
||||
|
||||
@@ -114,7 +114,7 @@ jobs:
|
||||
my_first_job:
|
||||
steps:
|
||||
- name: My first step
|
||||
uses: actions/setup-node@v1.1.0
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
```
|
||||
|
||||
### Hacer referencia a un contenedor en Docker Hub
|
||||
|
||||
@@ -94,20 +94,21 @@ Puedes crear un flujo de trabajo de ejemplo en tu repositorio que active automá
|
||||
|
||||
1. En tu repositorio, crea el directorio `.github/workflows/` para almacenar tus archivos de flujo de trabajo.
|
||||
1. En el directorio `.github/workflows/`, crea un archivo nuevo que se llame `learn-github-actions.yml` y agrega el siguiente código.
|
||||
```yaml
|
||||
name: learn-github-actions
|
||||
on: [push]
|
||||
jobs:
|
||||
check-bats-version:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
- run: npm install -g bats
|
||||
- run: bats -v
|
||||
```
|
||||
|
||||
```yaml
|
||||
name: learn-github-actions
|
||||
on: [push]
|
||||
jobs:
|
||||
check-bats-version:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '14'
|
||||
- run: npm install -g bats
|
||||
- run: bats -v
|
||||
```
|
||||
1. Confirma estos cambios y cárgalos a tu repositorio de {% data variables.product.prodname_dotcom %}.
|
||||
|
||||
Tu archivo de flujo de trabajo de {% data variables.product.prodname_actions %} nuevo estará ahora instalado en tu repositorio y se ejecutará automáticamente cada que alguien suba un cambio a éste. Para encontrar los detalles sobre el historial de ejecución un job, consulta la sección "[Visualizar la actividad del flujo de trabajo](/actions/learn-github-actions/introduction-to-github-actions#viewing-the-jobs-activity)".
|
||||
@@ -187,7 +188,7 @@ Define un job que se llame <code>check-bats-version</code>. Las llaves hijas def
|
||||
<td>
|
||||
|
||||
```yaml
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
```
|
||||
</td>
|
||||
<td>
|
||||
@@ -198,13 +199,13 @@ La palabra clave <code>uses</code> especifica que este paso ejecutará la <code>
|
||||
<td>
|
||||
|
||||
```yaml
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '14'
|
||||
```
|
||||
</td>
|
||||
<td>
|
||||
Este paso utiliza la acción <code>actions/setup-node@v2</code> para instalar la versión especificada del Node.js (este ejemplo utiliza la v14). Esto pone a los comandos <code>node</code> y <code>npm</code> en tu <code>PATH</code>.
|
||||
This step uses the <code>{% data reusables.actions.action-setup-node %}</code> action to install the specified version of the Node.js (this example uses v14). Esto pone a los comandos <code>node</code> y <code>npm</code> en tu <code>PATH</code>.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@@ -42,7 +42,7 @@ En el tutorial, prmero crearás un archivo de flujo de trabajo que utilice la [a
|
||||
issues: write
|
||||
pull-requests: write{% endif %}
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
- uses: {% data reusables.actions.action-stale %}
|
||||
with:
|
||||
days-before-issue-stale: 30
|
||||
days-before-issue-close: 14
|
||||
|
||||
@@ -315,19 +315,19 @@ jobs:
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
run_python:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: '3.7'
|
||||
architecture: 'x64'
|
||||
- run: python script.py
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -105,16 +105,16 @@ GitHub Actions
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
uses: {% data reusables.actions.action-cache %}
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }}
|
||||
key: {% raw %}v1-npm-deps-${{ hashFiles('**/package-lock.json') }}{% endraw %}
|
||||
restore-keys: v1-npm-deps-
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -155,10 +155,10 @@ GitHub Actions
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
- name: Upload math result for job 1
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: homework
|
||||
path: math-homework.txt
|
||||
@@ -166,11 +166,11 @@ GitHub Actions
|
||||
...
|
||||
|
||||
- name: Download math result for job 1
|
||||
uses: actions/download-artifact@v3
|
||||
uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: homework
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -250,7 +250,7 @@ workflows:
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
name: Containers
|
||||
|
||||
@@ -284,7 +284,7 @@ jobs:
|
||||
# See https://docs.github.com/actions/reference/virtual-environments-for-github-hosted-runners#docker-container-filesystem
|
||||
- name: Setup file system permissions
|
||||
run: sudo chmod -R 777 $GITHUB_WORKSPACE /github /__w/_temp
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Install dependencies
|
||||
run: bundle install --path vendor/bundle
|
||||
- name: Setup environment configuration
|
||||
@@ -294,7 +294,6 @@ jobs:
|
||||
- name: Run tests
|
||||
run: bundle exec rake
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -401,9 +400,9 @@ workflows:
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
{% endraw %}{% data reusables.actions.actions-not-certified-by-github-comment %}{% raw %}
|
||||
{% data reusables.actions.actions-not-certified-by-github-comment %}
|
||||
|
||||
name: Containers
|
||||
|
||||
@@ -436,16 +435,16 @@ jobs:
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Setup Ruby
|
||||
uses: eregon/use-ruby-action@477b21f02be01bcb8030d50f37cfec92bfa615b6
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
ruby-version: {% raw %}${{ matrix.ruby }}{% endraw %}
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
uses: {% data reusables.actions.action-cache %}
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: administrate-${{ matrix.image }}-${{ hashFiles('Gemfile.lock') }}
|
||||
key: administrate-{% raw %}${{ matrix.image }}-${{ hashFiles('Gemfile.lock') }}{% endraw %}
|
||||
- name: Install postgres headers
|
||||
run: |
|
||||
sudo apt-get update
|
||||
@@ -463,7 +462,6 @@ jobs:
|
||||
- name: Run appraisal
|
||||
run: bundle exec appraisal rake
|
||||
```
|
||||
{% endraw %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -65,15 +65,15 @@ job1:
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
job1:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- run: echo "Run your script here"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -341,20 +341,20 @@ test_async:
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
test_async:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
uses: {% data reusables.actions.action-cache %}
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }}
|
||||
key: {% raw %}v1-npm-deps-${{ hashFiles('**/package-lock.json') }}{% endraw %}
|
||||
restore-keys: v1-npm-deps-
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -388,15 +388,15 @@ artifacts:
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
- name: Upload math result for job 1
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: homework
|
||||
path: math-homework.txt
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -448,7 +448,7 @@ container-job:
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
container-job:
|
||||
@@ -463,7 +463,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
# Performs a clean installation of all dependencies
|
||||
# in the `package.json` file
|
||||
@@ -481,7 +481,7 @@ jobs:
|
||||
# The default PostgreSQL port
|
||||
POSTGRES_PORT: 5432
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -264,28 +264,26 @@ pipeline {
|
||||
</td>
|
||||
<td>
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: demo-workflow
|
||||
on:
|
||||
push:
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
runs-on: {% raw %}${{ matrix.os }}{% endraw %}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: 12
|
||||
- run: npm install -g bats
|
||||
- run: bats tests
|
||||
working-directory: scripts/myapp
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -164,13 +164,13 @@ git:
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
with:
|
||||
submodules: false
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -283,19 +283,19 @@ script:
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
run_python:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: '3.7'
|
||||
architecture: 'x64'
|
||||
- run: python script.py
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -323,16 +323,16 @@ cache: npm
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td class="d-table-cell v-align-top">
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
uses: {% data reusables.actions.action-cache %}
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }}
|
||||
key: {% raw %}v1-npm-deps-${{ hashFiles('**/package-lock.json') }}{% endraw %}
|
||||
restore-keys: v1-npm-deps-
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -402,7 +402,7 @@ script:
|
||||
{% endraw %}
|
||||
</td>
|
||||
<td>
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
name: Node.js CI
|
||||
on: [push]
|
||||
@@ -410,16 +410,16 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v2
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
- run: npm test
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||
@@ -151,7 +151,7 @@ jobs:
|
||||
contents: read{% endif %}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Log in to GitHub Docker Registry
|
||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||
@@ -197,7 +197,7 @@ jobs:
|
||||
contents: read{% endif %}
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||
|
||||
@@ -87,16 +87,16 @@ jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v2
|
||||
uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
|
||||
- name: Publish package
|
||||
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
|
||||
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
|
||||
with:
|
||||
arguments: publish
|
||||
env:
|
||||
@@ -159,15 +159,15 @@ jobs:
|
||||
contents: read
|
||||
packages: write {% endif %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
|
||||
- name: Publish package
|
||||
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
|
||||
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
|
||||
with:
|
||||
arguments: publish
|
||||
env:
|
||||
@@ -237,16 +237,16 @@ jobs:
|
||||
contents: read
|
||||
packages: write {% endif %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v2
|
||||
uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Validate Gradle wrapper
|
||||
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
|
||||
- name: Publish package
|
||||
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
|
||||
uses: gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
|
||||
with:
|
||||
arguments: publish
|
||||
env: {% raw %}
|
||||
|
||||
@@ -74,7 +74,6 @@ Con esta configuración, puedes crear un flujo de trabajo que publique tu paquet
|
||||
En el paso de implementación, necesitarás establecer las variables de entorno para el nombre de usuario con el que te autenticaste en el repositorio y para el secreto que hayas configurado con la contraseña o el token con que autenticarse. Para obtener más información, consulta "[Crear y usar secretos cifrados](/github/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)."
|
||||
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Publish package to the Maven Central Repository
|
||||
on:
|
||||
@@ -84,9 +83,9 @@ jobs:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Maven Central Repository
|
||||
uses: actions/setup-java@v2
|
||||
uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
@@ -96,10 +95,9 @@ jobs:
|
||||
- name: Publish package
|
||||
run: mvn --batch-mode deploy
|
||||
env:
|
||||
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
||||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
|
||||
MAVEN_USERNAME: {% raw %}${{ secrets.OSSRH_USERNAME }}{% endraw %}
|
||||
MAVEN_PASSWORD: {% raw %}${{ secrets.OSSRH_TOKEN }}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Este flujo de trabajo realiza los siguientes pasos:
|
||||
|
||||
@@ -150,8 +148,8 @@ jobs:
|
||||
contents: read
|
||||
packages: write {% endif %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
@@ -187,9 +185,9 @@ jobs:
|
||||
contents: read
|
||||
packages: write {% endif %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Java for publishing to Maven Central Repository
|
||||
uses: actions/setup-java@v2
|
||||
uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
@@ -198,18 +196,18 @@ jobs:
|
||||
server-password: MAVEN_PASSWORD
|
||||
- name: Publish to the Maven Central Repository
|
||||
run: mvn --batch-mode deploy
|
||||
env:{% raw %}
|
||||
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
||||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
|
||||
env:
|
||||
MAVEN_USERNAME: {% raw %}${{ secrets.OSSRH_USERNAME }}{% endraw %}
|
||||
MAVEN_PASSWORD: {% raw %}${{ secrets.OSSRH_TOKEN }}{% endraw %}
|
||||
- name: Set up Java for publishing to GitHub Packages
|
||||
uses: actions/setup-java@v2
|
||||
uses: {% data reusables.actions.action-setup-java %}
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Publish to GitHub Packages
|
||||
run: mvn --batch-mode deploy
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}{% endraw %}
|
||||
GITHUB_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
|
||||
```
|
||||
|
||||
Este flujo de trabajo llama a la acción `setup-java` dos veces. Cada vez que la acción `setup-java` se ejecuta, sobrescribe el archivo _settings.xml_ de Maven para publicar paquetes. Para la autenticación en el repositorio, el archivo _settings.xml_ hace referencia a la `id` del repositorio de administración de distribución y al nombre de usuario y contraseña.
|
||||
|
||||
@@ -61,7 +61,6 @@ Si estás publicando un paquete que incluye un prefijo de alcance, incluye el á
|
||||
|
||||
Este ejemplo almacena el secreto `NPM_TOKEN` en la variable de entorno `NODE_AUTH_TOKEN`. Cuando la acción `setup-node` crea un archivo *.npmrc*, hace referencia al token de la variable de entorno `NODE_AUTH_TOKEN`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Publish Package to npmjs
|
||||
on:
|
||||
@@ -71,18 +70,17 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
# Setup .npmrc file to publish to npm
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '16.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
- run: npm ci
|
||||
- run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NODE_AUTH_TOKEN: {% raw %}${{ secrets.NPM_TOKEN }}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
En el ejemplo anterior, la acción `setup-node` crea un archivo *.npmrc* en el ejecutor con el siguiente contenido:
|
||||
|
||||
@@ -96,7 +94,7 @@ Toma en cuenta que necesitas configurar la `registry-url` como `https://registry
|
||||
|
||||
## Sube paquetes al {% data variables.product.prodname_registry %}
|
||||
|
||||
Cada vez que creas un lanzamiento nuevo, puedes desencadenar un flujo de trabajo para publicar tu paquete. El flujo de trabajo en el ejemplo a continuación se ejecuta cada vez que se produce el evento `lanzamiento` con tipo `creado`. El flujo de trabajo publica el paquete en el {% data variables.product.prodname_registry %} si se superan las pruebas de CI.
|
||||
Cada vez que creas un lanzamiento nuevo, puedes desencadenar un flujo de trabajo para publicar tu paquete. El flujo de trabajo del siguiente ejemplo se ejecuta cada vez que se produce el evento `release` con tipo `created`. El flujo de trabajo publica el paquete en el {% data variables.product.prodname_registry %} si se superan las pruebas de CI.
|
||||
|
||||
### Configurar el repositorio de destino
|
||||
|
||||
@@ -115,7 +113,7 @@ Sin embargo, si no proporcionas la clave del `repository`, entonces el repositor
|
||||
|
||||
### Autenticarse en el repositorio de destino
|
||||
|
||||
Para realizar operaciones autenticadas en el registro {% data variables.product.prodname_registry %} de tu flujo de trabajo, puedes utilizar el `GITHUB_TOKEN`. {% data reusables.actions.github-token-permissions %}
|
||||
Para realizar operaciones autenticadas contra el registro {% data variables.product.prodname_registry %} en tu flujo de trabajo, puedes utilizar el `GITHUB_TOKEN`. {% data reusables.actions.github-token-permissions %}
|
||||
|
||||
Si quieres publicar tu paquete en un repositorio diferente, debes utilizar un token de acceso personal (PAT) que tenga permisos de escritura en los paquetes del repositorio destino. Para obtener más información, consulta las secciones "[Crear un token de acceso personal](/github/authenticating-to-github/creating-a-personal-access-token)" y "[Secretos cifrados](/actions/reference/encrypted-secrets)".
|
||||
|
||||
@@ -135,9 +133,9 @@ jobs:
|
||||
contents: read
|
||||
packages: write {% endif %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
# Setup .npmrc file to publish to GitHub Packages
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '16.x'
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
@@ -161,7 +159,6 @@ always-auth=true
|
||||
|
||||
Si usas el gestor de paquetes Yarn, puedes instalar y publicar paquetes mediante Yarn.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Publish Package to npmjs
|
||||
on:
|
||||
@@ -171,9 +168,9 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
# Setup .npmrc file to publish to npm
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: '16.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
@@ -182,6 +179,5 @@ jobs:
|
||||
- run: yarn
|
||||
- run: yarn publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NODE_AUTH_TOKEN: {% raw %}${{ secrets.NPM_TOKEN }}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
@@ -39,9 +39,9 @@ The following example shows you how {% data variables.product.prodname_actions %
|
||||
steps:
|
||||
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
|
||||
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
|
||||
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
|
||||
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."{% endraw %}
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}{% raw %}
|
||||
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
|
||||
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
|
||||
- name: List files in the repository
|
||||
|
||||
@@ -327,29 +327,27 @@ Los secretos tienen un tamaño máximo de 64 KB. Para usar secretos de un tamañ
|
||||
|
||||
1. En tu flujo de trabajo, usa un `step` para llamar al shell script y descifrar el secreto. Para tener una copia de tu repositorio en el entorno en el que se ejecuta tu flujo de trabajo, deberás usar la acción [`code>actions/checkout`](https://github.com/actions/checkout). Haz referencia a tu shell script usando el comando `run` relacionado con la raíz de tu repositorio.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Workflows with large secrets
|
||||
```yaml
|
||||
name: Workflows with large secrets
|
||||
|
||||
on: push
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
my-job:
|
||||
name: My Job
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Decrypt large secret
|
||||
run: ./.github/scripts/decrypt_secret.sh
|
||||
env:
|
||||
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
|
||||
# Este comando es solo un ejemplo para mostrar cómo se imprime tu secreto.
|
||||
# Asegúrate de eliminar las declaraciones impresas de tus secretos. GitHub
|
||||
# no oculta los secretos que usan esta solución.
|
||||
- name: Test printing your secret (Elimina este paso en la producción)
|
||||
run: cat $HOME/secrets/my_secret.json
|
||||
```
|
||||
{% endraw %}
|
||||
jobs:
|
||||
my-job:
|
||||
name: My Job
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Decrypt large secret
|
||||
run: ./.github/scripts/decrypt_secret.sh
|
||||
env:
|
||||
LARGE_SECRET_PASSPHRASE: {% raw %}${{ secrets. LARGE_SECRET_PASSPHRASE }}{% endraw %}
|
||||
# This command is just an example to show your secret being printed
|
||||
# Ensure you remove any print statements of your secrets. GitHub does
|
||||
# not hide secrets that use this workaround.
|
||||
- name: Test printing your secret (Remove this step in production)
|
||||
run: cat $HOME/secrets/my_secret.json
|
||||
```
|
||||
|
||||
## Almacenar blobs binarios en Base64 como secretos
|
||||
|
||||
@@ -385,7 +383,7 @@ Puedes utilizar el cifrado en Base64 para almacenar blobs binarios pequeños com
|
||||
decode-secret:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Retrieve the secret and decode it to a file
|
||||
env:
|
||||
{% raw %}CERTIFICATE_BASE64: ${{ secrets.CERTIFICATE_BASE64 }}{% endraw %}
|
||||
@@ -395,4 +393,3 @@ Puedes utilizar el cifrado en Base64 para almacenar blobs binarios pequeños com
|
||||
run: |
|
||||
openssl x509 -in cert.der -inform DER -text -noout
|
||||
```
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ También puede ser útil tener un conocimiento básico de YAML, la sintaxis para
|
||||
|
||||
{% data reusables.actions.copy-workflow-file %}
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: PostgreSQL service example
|
||||
on: push
|
||||
@@ -73,7 +72,7 @@ jobs:
|
||||
steps:
|
||||
# Downloads a copy of the code in your repository before running CI tests
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
# Performs a clean installation of all dependencies in the `package.json` file
|
||||
# For more information, see https://docs.npmjs.com/cli/ci.html
|
||||
@@ -91,7 +90,6 @@ jobs:
|
||||
# Puerto PostgreSQL predeterminado
|
||||
POSTGRES_PORT: 5432
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Configurar el trabajo del ejecutador
|
||||
|
||||
@@ -128,7 +126,7 @@ jobs:
|
||||
steps:
|
||||
# Downloads a copy of the code in your repository before running CI tests
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
# Performs a clean installation of all dependencies in the `package.json` file
|
||||
# For more information, see https://docs.npmjs.com/cli/ci.html
|
||||
@@ -158,7 +156,6 @@ Cuando ejecutes un trabajo directamente en la máquina del ejecutor, deberás as
|
||||
|
||||
{% data reusables.actions.copy-workflow-file %}
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: PostgreSQL Service Example
|
||||
on: push
|
||||
@@ -191,7 +188,7 @@ jobs:
|
||||
steps:
|
||||
# Downloads a copy of the code in your repository before running CI tests
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
# Performs a clean installation of all dependencies in the `package.json` file
|
||||
# For more information, see https://docs.npmjs.com/cli/ci.html
|
||||
@@ -210,7 +207,6 @@ jobs:
|
||||
# Puerto PostgreSQL predeterminado
|
||||
POSTGRES_PORT: 5432
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Configurar el trabajo del ejecutador
|
||||
|
||||
@@ -254,7 +250,7 @@ jobs:
|
||||
steps:
|
||||
# Downloads a copy of the code in your repository before running CI tests
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
# Performs a clean installation of all dependencies in the `package.json` file
|
||||
# For more information, see https://docs.npmjs.com/cli/ci.html
|
||||
|
||||
@@ -41,24 +41,25 @@ También puede ser útil tener una comprensión básica de YAML, la sintaxis par
|
||||
|
||||
{% data reusables.actions.copy-workflow-file %}
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Redis container example
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
# Etiqueta del trabajo del contenedor
|
||||
# Label of the container job
|
||||
container-job:
|
||||
# Los contenedores deben ejecutarse en sistemas operativos basados en Linux
|
||||
# Containers must run in Linux based operating systems
|
||||
runs-on: ubuntu-latest
|
||||
# Imagen de Docker Hub que `container-job` ejecuta en el contenedor: node:10.18-jessie
|
||||
# Docker Hub image that `container-job` executes in
|
||||
container: node:10.18-jessie
|
||||
|
||||
# Contenedores de servicio para ejecutar con `container-job`
|
||||
# Service containers to run with `container-job`
|
||||
services:
|
||||
# Etiqueta usada para acceder al contenedor de servicio redis:
|
||||
# Imagen del contenedor Docker Hub
|
||||
# Label used to access the service container
|
||||
redis:
|
||||
# Docker Hub image
|
||||
image: redis
|
||||
# Establece revisiones de estado para esperar hasta que Redis haya comenzado
|
||||
# Set health checks to wait until redis has started
|
||||
options: >-
|
||||
--health-cmd "redis-cli ping"
|
||||
--health-interval 10s
|
||||
@@ -66,27 +67,26 @@ jobs:
|
||||
--health-retries 5
|
||||
|
||||
steps:
|
||||
# Descarga una copia del código en tu repositorio antes de ejecutar pruebas de CI
|
||||
# Downloads a copy of the code in your repository before running CI tests
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
# Realiza una instalación limpia de todas las dependencias en el archivo `package.json`
|
||||
# Para obtener más información, consulta https://docs.npmjs.com/cli/ci.html
|
||||
# Performs a clean installation of all dependencies in the `package.json` file
|
||||
# For more information, see https://docs.npmjs.com/cli/ci.html
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Connect to Redis
|
||||
# Ejecuta un script que crea un cliente Redis, rellena
|
||||
# el cliente con datos y recupera datos
|
||||
# Runs a script that creates a Redis client, populates
|
||||
# the client with data, and retrieves data
|
||||
run: node client.js
|
||||
# Variable de entorno utilizada por el script `client.js` para crear un nuevo cliente Redis.
|
||||
# Environment variable used by the `client.js` script to create a new Redis client.
|
||||
env:
|
||||
# El nombre del host utilizado para comunicarse con el contenedor de servicio Redis
|
||||
REDIS_HOST: redis
|
||||
# El puerto Redis predeterminado
|
||||
REDIS_PORT: 6379
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Configurar el trabajo del contenedor
|
||||
|
||||
@@ -122,20 +122,20 @@ jobs:
|
||||
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
# Descarga una copia del código en tu repositorio antes de ejecutar pruebas de CI
|
||||
# Downloads a copy of the code in your repository before running CI tests
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
# Realiza una instalación limpia de todas las dependencias en el archivo `package.json`
|
||||
# Para obtener más información, consulta https://docs.npmjs.com/cli/ci.html
|
||||
# Performs a clean installation of all dependencies in the `package.json` file
|
||||
# For more information, see https://docs.npmjs.com/cli/ci.html
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Connect to Redis
|
||||
# Ejecuta un script que crea un cliente Redis, rellena
|
||||
# el cliente con datos y recupera datos
|
||||
# Runs a script that creates a Redis client, populates
|
||||
# the client with data, and retrieves data
|
||||
run: node client.js
|
||||
# Variable de entorno utilizada por el script `client.js` para crear un nuevo cliente Redis.
|
||||
# Environment variable used by the `client.js` script to create a new Redis client.
|
||||
env:
|
||||
# El nombre del host utilizado para comunicarse con el contenedor del servicio Redis
|
||||
REDIS_HOST: redis
|
||||
@@ -153,56 +153,54 @@ Cuando ejecutes un trabajo directamente en la máquina del ejecutor, deberás as
|
||||
|
||||
{% data reusables.actions.copy-workflow-file %}
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Redis runner example
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
# Etiqueta del trabajo del ejecutor
|
||||
# Label of the runner job
|
||||
runner-job:
|
||||
# Debes usar un entorno Linux cuando utilices contenedores de servicio o trabajos de contenedor
|
||||
# You must use a Linux environment when using service containers or container jobs
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Contenedores de servicio para ejecutar con `runner-job`
|
||||
# Service containers to run with `runner-job`
|
||||
services:
|
||||
# Etiqueta usada para acceder al contenedor de servicio
|
||||
# Label used to access the service container
|
||||
redis:
|
||||
# Imagen de Docker Hub
|
||||
# Docker Hub image
|
||||
image: redis
|
||||
# Establece revisiones de estado para esperar hasta que Redis haya comenzado
|
||||
# Set health checks to wait until redis has started
|
||||
options: >-
|
||||
--health-cmd "redis-cli ping"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
ports:
|
||||
# Asigna el puerto 6379 en el contenedor de servicio al host
|
||||
# Maps port 6379 on service container to the host
|
||||
- 6379:6379
|
||||
|
||||
steps:
|
||||
# Descarga una copia del código en tu repositorio antes de ejecutar pruebas de CI
|
||||
# Downloads a copy of the code in your repository before running CI tests
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
# Realiza una instalación limpia de todas las dependencias en el archivo `package.json`
|
||||
# Para obtener más información, consulta https://docs.npmjs.com/cli/ci.html
|
||||
# Performs a clean installation of all dependencies in the `package.json` file
|
||||
# For more information, see https://docs.npmjs.com/cli/ci.html
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Connect to Redis
|
||||
# Ejecuta un script que crea un cliente Redis, rellena
|
||||
# el cliente con datos y recupera datos
|
||||
# Runs a script that creates a Redis client, populates
|
||||
# the client with data, and retrieves data
|
||||
run: node client.js
|
||||
# Variable de entorno utilizada por el script `client.js` para crear
|
||||
# un nuevo cliente Redis.
|
||||
# Environment variable used by the `client.js` script to create
|
||||
# a new Redis client.
|
||||
env:
|
||||
# El nombre del host utilizado para comunicarse con el contenedor del servicio Redis
|
||||
REDIS_HOST: localhost
|
||||
# El puerto Redis predeterminado
|
||||
REDIS_PORT: 6379
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Configurar el trabajo del ejecutador
|
||||
|
||||
@@ -242,21 +240,21 @@ jobs:
|
||||
|
||||
```yaml{:copy}
|
||||
steps:
|
||||
# Descarga una copia del código en tu repositorio antes de ejecutra pruebas de CI
|
||||
# Downloads a copy of the code in your repository before running CI tests
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
# Realiza una instalación limpia de todas las dependencias en el archivo `package.json`
|
||||
# Para obtener más información, consulta https://docs.npmjs.com/cli/ci.html
|
||||
# Performs a clean installation of all dependencies in the `package.json` file
|
||||
# For more information, see https://docs.npmjs.com/cli/ci.html
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Connect to Redis
|
||||
# Ejecuta un script que crea un cliente Redis, rellena
|
||||
# el cliente con datos y recupera datos
|
||||
# Runs a script that creates a Redis client, populates
|
||||
# the client with data, and retrieves data
|
||||
run: node client.js
|
||||
# Variable de entorno utilizada por el script `client.js` para crear
|
||||
# un nuevo cliente Redis.
|
||||
# Environment variable used by the `client.js` script to create
|
||||
# a new Redis client.
|
||||
env:
|
||||
# El nombre del host utilizado para comunicarse con el contenedor del servicio Redis
|
||||
REDIS_HOST: localhost
|
||||
|
||||
@@ -80,7 +80,6 @@ For the overall list of included tools for each runner operating system, see the
|
||||
* [Ubuntu 18.04 LTS](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-Readme.md)
|
||||
* [Windows Server 2022](https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md)
|
||||
* [Windows Server 2019](https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md)
|
||||
* [Windows Server 2016](https://github.com/actions/virtual-environments/blob/main/images/win/Windows2016-Readme.md)
|
||||
* [macOS 11](https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md)
|
||||
* [macOS 10.15](https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md)
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ This guide demonstrates how to create a job that installs additional software on
|
||||
|
||||
The following example demonstrates how to install an `apt` package as part of a job.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Build on Ubuntu
|
||||
on: push
|
||||
@@ -32,13 +31,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Install jq tool
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install jq
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
{% note %}
|
||||
|
||||
@@ -50,7 +48,6 @@ jobs:
|
||||
|
||||
The following example demonstrates how to install Brew packages and casks as part of a job.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Build on macOS
|
||||
on: push
|
||||
@@ -60,7 +57,7 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Install GitHub CLI
|
||||
run: |
|
||||
brew update
|
||||
@@ -70,7 +67,6 @@ jobs:
|
||||
brew update
|
||||
brew install --cask microsoft-edge
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
## Installing software on Windows runners
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ Para obtener más información, consulta la sección "[Definir los jobs de prerr
|
||||
|
||||
Puedes utilizar una matriz de compilaciones si quieres que tu flujo de trabajo ejecute pruebas a través de varias combinaciones de sistemas operativos, plataformas y lenguajes. La matriz de compilaciones se crea utilizando la palabra clave `strategy`, la cual recibe las opciones de compilación como un arreglo. Por ejemplo, esta matriz de compilaciones ejecutará el job varias veces, utilizando diferentes versiones de Node.js:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
build:
|
||||
@@ -83,11 +82,10 @@ jobs:
|
||||
matrix:
|
||||
node: [6, 8, 10]
|
||||
steps:
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
node-version: {% raw %}${{ matrix.node }}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Para obtener más información, consulte la sección "[Utilizar una matriz de compilación para tus jobs](/actions/using-jobs/using-a-build-matrix-for-your-jobs)".
|
||||
|
||||
@@ -98,22 +96,20 @@ Los ejecutores hospedados en {% data variables.product.prodname_dotcom %} se ini
|
||||
|
||||
Este ejemplo ilustra cómo almacenar el directorio `~/.npm` en el caché:
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
example-job:
|
||||
steps:
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
uses: {% data reusables.actions.action-cache %}
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
key: {% raw %}${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}{% endraw %}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
{% raw %}${{ runner.os }}-build-${{ env.cache-name }}-{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Para obtener más información, consulta la sección "<a href="/actions/guides/caching-dependencies-to-speed-up-workflows" class="dotcom-only">Almacenar las dependencias en caché para agilizar los flujos de trabajo</a>".
|
||||
{% endif %}
|
||||
@@ -132,7 +128,7 @@ jobs:
|
||||
image: postgres
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Connect to PostgreSQL
|
||||
|
||||
@@ -92,9 +92,10 @@ Para más información, consulta [`actions/cache`](https://github.com/actions/ca
|
||||
- `path`: **Obligatorio** La ruta del archivo en el ejecutor para almacenar en caché o restaurar. The path can be an absolute path or relative to the workspace directory.
|
||||
- Las rutas pueden ser tanto directorios o solo archivos, y los patrones estilo glob son compatibles.
|
||||
- Con la `v2` de la acción `cache`, puedes especificar una ruta sencilla o puedes agregar rutas múltiples en líneas separadas. Por ejemplo:
|
||||
|
||||
```
|
||||
- name: Cache Gradle packages
|
||||
uses: actions/cache@v2
|
||||
uses: {% data reusables.actions.action-cache %}
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
@@ -111,7 +112,6 @@ Para más información, consulta [`actions/cache`](https://github.com/actions/ca
|
||||
|
||||
Este ejemplo crea una nueva memoria caché cuando los paquetes en el archivo `package-lock.json` cambian o cuando cambia el sistema operativo del ejecutor. La clave de caché usa contextos y expresiones para generar una clave que incluye el sistema operativo del ejecutor y un hash SHA-256 del archivo `package-lock.json`.
|
||||
|
||||
{% raw %}
|
||||
```yaml{:copy}
|
||||
name: Caching with npm
|
||||
|
||||
@@ -122,20 +122,20 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
uses: {% data reusables.actions.action-cache %}
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
key: {% raw %}${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}{% endraw %}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
{% raw %}${{ runner.os }}-build-${{ env.cache-name }}-{% endraw %}
|
||||
{% raw %}${{ runner.os }}-build-{% endraw %}
|
||||
{% raw %}${{ runner.os }}-{% endraw %}
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
@@ -146,7 +146,6 @@ jobs:
|
||||
- name: Test
|
||||
run: npm test
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
Cuando `key` coincide con una caché existente, se denomina hit de caché y la acción restaura los archivos almacenados en la caché al directorio `path`.
|
||||
|
||||
@@ -172,7 +171,7 @@ npm-${{ hashFiles('package-lock.json') }}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
{% data variables.product.prodname_dotcom %} evalúa la expresión `"package-lock.json"` para obtener la última `key`.
|
||||
{% data variables.product.prodname_dotcom %} evalúa la expresión `hash "package-lock.json"` para obtener la última `key`.
|
||||
|
||||
```yaml
|
||||
npm-d5ea0750
|
||||
|
||||
@@ -66,7 +66,7 @@ Este procedimiento demuestra cómo crear un flujo de trabajo inicial y archivo d
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Run a one-line script
|
||||
run: echo Hello from Octo Organization
|
||||
|
||||
@@ -1079,6 +1079,12 @@ on:
|
||||
types: [on-demand-test]
|
||||
```
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** The `event_type` value is limited to 100 characters.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
Cualquier dato que envíes a través del parámetro `client_payload` estará disponible en el contexto `github.event` en tu flujo de trabajo. Por ejemplo, si envías este cuerpo de solicitud cuando creas un evento de despacho de repositorio:
|
||||
|
||||
```json
|
||||
@@ -1149,7 +1155,7 @@ Puedes usar estos operadores en cualquiera de los cinco campos:
|
||||
|
||||
{% endnote %}
|
||||
|
||||
Puedes usar [contrab guru](https://crontab.guru/) para ayudar a generar tu sintaxis de cron y confirmar a qué hora se ejecutará. Para que puedas comenzar, hay también una lista de [ejemplos de crontab guru](https://crontab.guru/examples.html).
|
||||
Puedes usar [contrab guru](https://crontab.guru/) para generar tu sintaxis de cron y confirmar a qué hora se ejecutará. Para que puedas comenzar, hay también una lista de [ejemplos de crontab guru](https://crontab.guru/examples.html).
|
||||
|
||||
Las notificaciones para los flujos de trabajo programados se envían al usuario que modificó por última vez la sintaxis de cron en el archivo de flujo de trabajo. Para obtener más información, consulta la sección "[Notificaciones para las ejecuciones de flujo de trabajo](/actions/guides/about-continuous-integration#notifications-for-workflow-runs)".
|
||||
|
||||
@@ -1163,7 +1169,7 @@ Las notificaciones para los flujos de trabajo programados se envían al usuario
|
||||
|
||||
Ejecuta tu flujo de trabajo cuando cambia el estado de una confirmación de Git. Por ejemplo, las confirmaciones pueden marcarse como `error`, `failure`, `pending` o `success`. Si quieres proporcionar más detalles sobre el cambio de estado, puede que quieras utilizar el evento [`check_run`](#check_run). Para obtener más información sobre las API de estado de confirmación, consulta la sección "[Estado](/graphql/reference/objects#statue)" en la documentación de la API de GraphQL o "[Estados](/rest/reference/commits#commit-statuses)" en la documentación de la API de REST.
|
||||
|
||||
Por ejemplo, puedes ejecutar un flujo de trabajo cuando se produzca el evento de `estado`.
|
||||
Por ejemplo, puedes ejecutar un flujo de trabajo cuando se produzca el evento `status`.
|
||||
|
||||
```yaml
|
||||
on:
|
||||
@@ -1429,7 +1435,7 @@ jobs:
|
||||
run: |
|
||||
mkdir -p ./pr
|
||||
echo $PR_NUMBER > ./pr/pr_number
|
||||
- uses: actions/upload-artifact@v3
|
||||
- uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: pr_number
|
||||
path: pr/
|
||||
@@ -1451,7 +1457,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Download artifact'
|
||||
uses: actions/github-script@v5
|
||||
uses: {% data reusables.actions.action-github-script %}
|
||||
with:
|
||||
script: |
|
||||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
||||
@@ -1475,7 +1481,7 @@ jobs:
|
||||
run: unzip pr_number.zip
|
||||
|
||||
- name: 'Comment on PR'
|
||||
uses: actions/github-script@v5
|
||||
uses: {% data reusables.actions.action-github-script %}
|
||||
with:
|
||||
github-token: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
|
||||
script: |
|
||||
|
||||
@@ -94,21 +94,21 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: npm install, build, and test
|
||||
run: |
|
||||
npm install
|
||||
npm run build --if-present
|
||||
npm test
|
||||
- name: Archive production artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: dist-without-markdown
|
||||
path: |
|
||||
dist
|
||||
!dist/**/*.md
|
||||
- name: Archive code coverage results
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: code-coverage-report
|
||||
path: output/test/code-coverage.html
|
||||
@@ -120,7 +120,7 @@ Puedes definir un periodo de retención personalizado para los artefactos indivu
|
||||
|
||||
```yaml{:copy}
|
||||
- name: 'Upload Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: my-artifact
|
||||
path: my_file.txt
|
||||
@@ -149,7 +149,7 @@ Especificar el nombre de un artefacto para descargar un artefacto individual. Si
|
||||
|
||||
```yaml
|
||||
- name: Download a single artifact
|
||||
uses: actions/download-artifact@v3
|
||||
uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: my-artifact
|
||||
```
|
||||
@@ -158,7 +158,7 @@ También puedes descargar todos los artefactos en una ejecución de flujo de tra
|
||||
|
||||
```yaml
|
||||
- name: Download all workflow run artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: {% data reusables.actions.action-download-artifact %}
|
||||
```
|
||||
|
||||
Si descargas todos los artefactos de una ejecución de flujo de trabajo, se creará un directorio para cada uno de ellos utilizando su nombre.
|
||||
@@ -200,7 +200,7 @@ jobs:
|
||||
run: |
|
||||
expr 3 + 7 > math-homework.txt
|
||||
- name: Upload math result for job 1
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: homework
|
||||
path: math-homework.txt
|
||||
@@ -211,7 +211,7 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Download math result for job 1
|
||||
uses: actions/download-artifact@v3
|
||||
uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: homework
|
||||
- shell: bash
|
||||
@@ -219,7 +219,7 @@ jobs:
|
||||
value=`cat math-homework.txt`
|
||||
expr $value \* 9 > math-homework.txt
|
||||
- name: Upload math result for job 2
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: homework
|
||||
path: math-homework.txt
|
||||
@@ -230,7 +230,7 @@ jobs:
|
||||
runs-on: macOS-latest
|
||||
steps:
|
||||
- name: Download math result for job 2
|
||||
uses: actions/download-artifact@v3
|
||||
uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: homework
|
||||
- name: Print the final result
|
||||
|
||||
@@ -391,9 +391,9 @@ steps:
|
||||
# Reference a specific commit
|
||||
- uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675
|
||||
# Reference the major version of a release
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
# Reference a specific version
|
||||
- uses: actions/checkout@v2.2.0
|
||||
- uses: {% data reusables.actions.action-checkout %}.2.0
|
||||
# Reference a branch
|
||||
- uses: actions/checkout@main
|
||||
```
|
||||
@@ -441,7 +441,7 @@ jobs:
|
||||
my_first_job:
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use local my-action
|
||||
uses: ./.github/actions/my-action
|
||||
```
|
||||
@@ -495,22 +495,20 @@ Your workflow must checkout the private repository and reference the action loca
|
||||
|
||||
Replace `PERSONAL_ACCESS_TOKEN` in the example with the name of your secret.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
jobs:
|
||||
my_first_job:
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
with:
|
||||
repository: octocat/my-private-repo
|
||||
ref: v1.0
|
||||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
|
||||
token: {% raw %}${{ secrets.PERSONAL_ACCESS_TOKEN }}{% endraw %}
|
||||
path: ./.github/actions/my-private-repo
|
||||
- name: Run my action
|
||||
uses: ./.github/actions/my-private-repo/my-action
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### `jobs.<job_id>.steps[*].run`
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ Puedes poblar el caché de la herramienta del ejecutor si ejecutas un flujo de t
|
||||
|
||||
El siguiente ejemplo muestra un flujo de trabajo que carga el caché de la herramienta para un ambiente de Ubuntu 18.04 utilizando la acción `setup-node` con las versiones 10 y 12 de Node.js.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
name: Upload Node.js 10 and 12 tool cache
|
||||
on: push
|
||||
@@ -58,26 +57,25 @@ Puedes poblar el caché de la herramienta del ejecutor si ejecutas un flujo de t
|
||||
steps:
|
||||
- name: Clear any existing tool cache
|
||||
run: |
|
||||
mv "${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old"
|
||||
mkdir -p "${{ runner.tool_cache }}"
|
||||
mv "{% raw %}${{ runner.tool_cache }}" "${{ runner.tool_cache }}.old"{% endraw %}
|
||||
mkdir -p "{% raw %}${{ runner.tool_cache }}{% endraw %}"
|
||||
- name: Setup Node 10
|
||||
uses: actions/setup-node@v2
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: 10.x
|
||||
- name: Setup Node 12
|
||||
uses: actions/setup-node@v2
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: 12.x
|
||||
- name: Archive tool cache
|
||||
run: |
|
||||
cd "${{ runner.tool_cache }}"
|
||||
cd "{% raw %}${{ runner.tool_cache }}{% endraw %}"
|
||||
tar -czf tool_cache.tar.gz *
|
||||
- name: Upload tool cache artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
path: ${{runner.tool_cache}}/tool_cache.tar.gz
|
||||
path: {% raw %}${{runner.tool_cache}}/tool_cache.tar.gz{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
1. Descarga el artefacto del caché de la herramienta desde la ejecución del flujo de trabajo. Para obtener instrucciones sobre còmo descargar artefactos, consulta la secciòn "[Descargar artefactos de los flujos de trabajo](/actions/managing-workflow-runs/downloading-workflow-artifacts)".
|
||||
1. Transfiere el artefacto del caché de la herramienta a tu ejecutor auto-hospedado y extráelo al directorio local del caché de la herramienta. El directorio predeterminado del caché de la herramienta es `RUNNER_DIR/_work/_tool`. Si el ejecutor no ha procesado ningún job aún, podrías necesitar crear los directorios `_work/_tool`.
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ To update the bundled actions, you can use the `actions-sync` tool to update the
|
||||
|
||||
You can use {% data variables.product.prodname_github_connect %} to allow {% data variables.product.product_name %} to use actions from {% data variables.product.prodname_dotcom_the_website %}. For more information, see "[Enabling automatic access to {% data variables.product.prodname_dotcom_the_website %} actions using {% data variables.product.prodname_github_connect %}](/admin/github-actions/enabling-automatic-access-to-githubcom-actions-using-github-connect)."
|
||||
|
||||
Once {% data variables.product.prodname_github_connect %} is configured, you can use the latest version of an action by deleting its local repository in the `actions` organization on your instance. For example, if your enterprise instance is using the `actions/checkout@v1` action, and you need to use `actions/checkout@v2` which isn't available on your enterprise instance, perform the following steps to be able to use the latest `checkout` action from {% data variables.product.prodname_dotcom_the_website %}:
|
||||
Once {% data variables.product.prodname_github_connect %} is configured, you can use the latest version of an action by deleting its local repository in the `actions` organization on your instance. For example, if your enterprise instance is using `v1` of the `actions/checkout` action, and you need to use `{% data reusables.actions.action-checkout %}` which isn't available on your enterprise instance, perform the following steps to be able to use the latest `checkout` action from {% data variables.product.prodname_dotcom_the_website %}:
|
||||
|
||||
1. From an enterprise owner account on {% data variables.product.product_name %}, navigate to the repository you want to delete from the *actions* organization (in this example `checkout`).
|
||||
1. By default, site administrators are not owners of the bundled *actions* organization. To get the access required to delete the `checkout` repository, you must use the site admin tools. Click {% octicon "rocket" aria-label="The rocket ship" %} in the upper-right corner of any page in that repository.
|
||||
@@ -44,8 +44,8 @@ Once {% data variables.product.prodname_github_connect %} is configured, you can
|
||||
1. Under "Repository info", click **View code** to leave the site admin pages and display the `checkout` repository.
|
||||
1. Delete the `checkout` repository within the `actions` organization. For information on how to delete a repository, see "[Deleting a repository](/github/administering-a-repository/deleting-a-repository)."
|
||||

|
||||
1. Configure your workflow's YAML to use `actions/checkout@v2`.
|
||||
1. Each time your workflow runs, the runner will use the `v2` version of `actions/checkout` from {% data variables.product.prodname_dotcom_the_website %}.
|
||||
1. Configure your workflow's YAML to use `{% data reusables.actions.action-checkout %}`.
|
||||
1. Each time your workflow runs, the runner will use the specified version of `actions/checkout` from {% data variables.product.prodname_dotcom_the_website %}.
|
||||
|
||||
{% ifversion ghes > 3.2 or ghae-issue-4815 %}
|
||||
{% note %}
|
||||
|
||||
@@ -31,7 +31,7 @@ Como alternativa, también puedes configurar el SSO de SAML utilizando Okta para
|
||||
## Agregar la aplicación {% data variables.product.prodname_ghe_cloud %} en Okta
|
||||
|
||||
{% data reusables.saml.okta-sign-into-your-account %}
|
||||
1. Navega a la aplicación [GitHub Enterprise Cloud - Cuentas Empresariales](https://www.okta.com/integrations/github-enterprise-cloud-enterprise-accounts) en la red de integración de Okta y haz clic en **Agregar integración**.
|
||||
1. Navigate to the [{% data variables.product.prodname_ghe_cloud %} - Enterprise Accounts](https://www.okta.com/integrations/github-enterprise-cloud-enterprise-accounts) application in the Okta Integration Network and click **Add Integration**.
|
||||
{% data reusables.saml.okta-dashboard-click-applications %}
|
||||
1. Opcionalmente, a la derecha de la "Etiqueta de aplicación", teclea un nombre descriptivo para la aplicación.
|
||||
1. A la derecha de "Empresas de {% data variables.product.prodname_dotcom %}", teclea el nombre de tu cuenta empresarial. Por ejemplo, si la URL de tu cuenta empresarial es `https://github.com/enterprises/octo-corp`, teclea `octo-corp`.
|
||||
|
||||
@@ -154,6 +154,16 @@ Action | Description
|
||||
`repo.config.lock_anonymous_git_access` | A repository's anonymous Git read access setting is locked, preventing repository administrators from changing (enabling or disabling) this setting. For more information, see "[Preventing users from changing anonymous Git read access](/enterprise/{{ currentVersion }}/admin/guides/user-management/preventing-users-from-changing-anonymous-git-read-access)."
|
||||
`repo.config.unlock_anonymous_git_access` | A repository's anonymous Git read access setting is unlocked, allowing repository administrators to change (enable or disable) this setting. For more information, see "[Preventing users from changing anonymous Git read access](/enterprise/{{ currentVersion }}/admin/guides/user-management/preventing-users-from-changing-anonymous-git-read-access)."{% endif %}
|
||||
|
||||
{% if secret-scanning-audit-log-custom-patterns %}
|
||||
## Secret scanning
|
||||
|
||||
Action | Description
|
||||
----------------------------- | -----------------------------------------------
|
||||
| `business_secret_scanning_custom_pattern.create` | Triggered when an enterprise-level custom pattern is published for secret scanning. For more information, see "[Defining custom patterns for secret scanning](/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning#defining-a-custom-pattern-for-an-enterprise-account)."
|
||||
| `business_secret_scanning_custom_pattern.update` | Triggered when changes to an enterprise-level custom pattern are saved for secret scanning.
|
||||
| `business_secret_scanning_custom_pattern.delete` | Triggered when an enterprise-level custom pattern is removed from secret scanning.
|
||||
{% endif %}
|
||||
|
||||
## Site admin tools
|
||||
|
||||
Action | Description
|
||||
|
||||
@@ -97,16 +97,10 @@ Si tienes múltiples llaves GPG, le debes decir a Git cuál utilizar.
|
||||
{% data reusables.gpg.list-keys-with-note %}
|
||||
{% data reusables.gpg.copy-gpg-key-id %}
|
||||
{% data reusables.gpg.paste-gpg-key-id %}
|
||||
1. Para agregar tu llave GPG a tu perfil bash, ejecuta el siguiente comando:
|
||||
```shell
|
||||
$ if [ -r ~/.bash_profile ]; then echo 'export GPG_TTY=$(tty)' >> ~/.bash_profile; \
|
||||
else echo 'export GPG_TTY=$(tty)' >> ~/.profile; fi
|
||||
1. To add your GPG key to your `.bashrc` startup file, run the following command:
|
||||
```bash
|
||||
$ [ -f ~/.bashrc ] && echo 'export GPG_TTY=$(tty)' >> ~/.bashrc
|
||||
```
|
||||
{% note %}
|
||||
|
||||
**Nota:** Si no tienes `.bash_profile`, este comando agrega tu llave GPG al `.profile`.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
{% endlinux %}
|
||||
|
||||
|
||||
@@ -63,3 +63,4 @@ Existing sponsorships will remain in place during this period and maintainers wi
|
||||
4. Review your billing and payment information. If you need to make an edit, click **Edit** next to the relevant section. Otherwise, click **Submit payment**. 
|
||||
5. Optionally, if you clicked **Edit**, make any necessary changes, and then click **Submit payment**. 
|
||||
6. Once payment for the current billing cycle has been successfully made, the **Pay now** button on your "Billing & plans" page will be disabled until your next payment is due. 
|
||||
|
||||
|
||||
@@ -56,6 +56,22 @@ To calculate the security severity of an alert, we use Common Vulnerability Scor
|
||||
|
||||
By default, any {% data variables.product.prodname_code_scanning %} results with a security severity of `Critical` or `High` will cause a check failure. You can specify which security severity level for {% data variables.product.prodname_code_scanning %} results should cause a check failure. For more information, see "[Defining the severities causing pull request check failure](/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#defining-the-severities-causing-pull-request-check-failure)."{% endif %}
|
||||
|
||||
{% ifversion fpt or ghes > 3.4 or ghae-issue-6251 or ghec %}
|
||||
### About analysis origins
|
||||
|
||||
You can set up multiple configurations of code analysis on a repository, using different tools and targeting different languages or areas of the code. Each configuration of code scanning is the analysis origin for all the alerts it generates. For example, an alert generated using the default CodeQL analysis with GitHub Actions will have a different analysis origin from an alert generated externally and uploaded via the code scanning API.
|
||||
|
||||
If you use multiple configurations to analyze a file, any problems detected by the same query are reported as alerts with multiple analysis origins. If an alert has more than one analysis origin, a {% octicon "workflow" aria-label="The workflow icon" %} icon will appear next to any relevant branch in the **Affected branches** section on the right-hand side of the alert page. You can hover over the {% octicon "workflow" aria-label="The workflow icon" %} icon to see the names of each analysis origin and the status of the alert for that analysis origin. You can also view the history of when alerts appeared in each analysis origin in the timeline on the alert page. If an alert only has one analysis origin, no information about analysis origins is displayed on the alert page.
|
||||
|
||||

|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** Sometimes a code scanning alert displays as fixed for one analysis origin but is still open for a second analysis origin. You can resolve this by re-running the second code scanning configuration to update the alert status for that analysis origin.
|
||||
|
||||
{% endnote %}
|
||||
|
||||
{% endif %}
|
||||
### About labels for alerts that are not found in application code
|
||||
|
||||
{% data variables.product.product_name %} assigns a category label to alerts that are not found in application code. The label relates to the location of the alert.
|
||||
@@ -108,7 +124,7 @@ The default {% data variables.product.prodname_codeql %} query suites do not inc
|
||||
When you update your workflow to run an additional query suite this will increase the analysis time.
|
||||
|
||||
``` yaml
|
||||
- uses: github/codeql-action/init@v1
|
||||
- uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
# Run extended queries including queries using machine learning
|
||||
queries: security-extended
|
||||
|
||||
@@ -193,13 +193,11 @@ For recommended specifications (RAM, CPU cores, and disk) for running {% data va
|
||||
|
||||
In general, you do not need to worry about where the {% data variables.product.prodname_codeql_workflow %} places {% data variables.product.prodname_codeql %} databases since later steps will automatically find databases created by previous steps. However, if you are writing a custom workflow step that requires the {% data variables.product.prodname_codeql %} database to be in a specific disk location, for example to upload the database as a workflow artifact, you can specify that location using the `db-location` parameter under the `init` action.
|
||||
|
||||
{% raw %}
|
||||
``` yaml
|
||||
- uses: github/codeql-action/init@v1
|
||||
- uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
db-location: '${{ github.workspace }}/codeql_dbs'
|
||||
db-location: {% raw %}'${{ github.workspace }}/codeql_dbs'{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
The {% data variables.product.prodname_codeql_workflow %} will expect the path provided in `db-location` to be writable, and either not exist, or be an empty directory. When using this parameter in a job running on a self-hosted runner or using a Docker container, it's the responsibility of the user to ensure that the chosen directory is cleared between runs, or that the databases are removed once they are no longer needed. {% ifversion fpt or ghec or ghes %} This is not necessary for jobs running on {% data variables.product.prodname_dotcom %}-hosted runners, which obtain a fresh instance and a clean filesystem each time they run. For more information, see "[About {% data variables.product.prodname_dotcom %}-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners)."{% endif %}
|
||||
|
||||
@@ -232,7 +230,7 @@ jobs:
|
||||
If your workflow does not contain a matrix called `language`, then {% data variables.product.prodname_codeql %} is configured to run analysis sequentially. If you don't specify languages in the workflow, {% data variables.product.prodname_codeql %} automatically detects, and attempts to analyze, any supported languages in the repository. If you want to choose which languages to analyze, without using a matrix, you can use the `languages` parameter under the `init` action.
|
||||
|
||||
```yaml
|
||||
- uses: github/codeql-action/init@v1
|
||||
- uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
languages: cpp, csharp, python
|
||||
```
|
||||
@@ -257,9 +255,9 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
uses: {% data reusables.actions.action-setup-python %}
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
@@ -272,7 +270,7 @@ jobs:
|
||||
# that includes the dependencies
|
||||
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
languages: python
|
||||
# Override the default behavior so that the action doesn't attempt
|
||||
@@ -288,17 +286,15 @@ Use `category` to distinguish between multiple analyses for the same tool and co
|
||||
|
||||
This parameter is particularly useful if you work with monorepos and have multiple SARIF files for different components of the monorepo.
|
||||
|
||||
{% raw %}
|
||||
``` yaml
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze
|
||||
uses: {% data reusables.actions.action-codeql-action-analyze %}
|
||||
with:
|
||||
# Optional. Specify a category to distinguish between multiple analyses
|
||||
# for the same tool and ref. If you don't use `category` in your workflow,
|
||||
# GitHub will generate a default category name for you
|
||||
category: "my_category"
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
If you don't specify a `category` parameter in your workflow, {% data variables.product.product_name %} will generate a category name for you, based on the name of the workflow file triggering the action, the action name, and any matrix variables. For example:
|
||||
- The `.github/workflows/codeql-analysis.yml` workflow and the `analyze` action will produce the category `.github/workflows/codeql.yml:analyze`.
|
||||
@@ -319,7 +315,7 @@ Your specified category will not overwrite the details of the `runAutomationDeta
|
||||
|
||||
{% data reusables.code-scanning.beta-codeql-packs-cli %}
|
||||
|
||||
To add one or more {% data variables.product.prodname_codeql %} query packs (beta), add a `with: packs:` entry within the `uses: github/codeql-action/init@v1` section of the workflow. Within `packs` you specify one or more packages to use and, optionally, which version to download. Where you don't specify a version, the latest version is downloaded. If you want to use packages that are not publicly available, you need to set the `GITHUB_TOKEN` environment variable to a secret that has access to the packages. For more information, see "[Authentication in a workflow](/actions/reference/authentication-in-a-workflow)" and "[Encrypted secrets](/actions/reference/encrypted-secrets)."
|
||||
To add one or more {% data variables.product.prodname_codeql %} query packs (beta), add a `with: packs:` entry within the `uses: {% data reusables.actions.action-codeql-action-init %}` section of the workflow. Within `packs` you specify one or more packages to use and, optionally, which version to download. Where you don't specify a version, the latest version is downloaded. If you want to use packages that are not publicly available, you need to set the `GITHUB_TOKEN` environment variable to a secret that has access to the packages. For more information, see "[Authentication in a workflow](/actions/reference/authentication-in-a-workflow)" and "[Encrypted secrets](/actions/reference/encrypted-secrets)."
|
||||
|
||||
{% note %}
|
||||
|
||||
@@ -329,28 +325,24 @@ To add one or more {% data variables.product.prodname_codeql %} query packs (bet
|
||||
|
||||
In the example below, `scope` is the organization or personal account that published the package. When the workflow runs, the three {% data variables.product.prodname_codeql %} query packs are downloaded from {% data variables.product.product_name %} and the default queries or query suite for each pack run. The latest version of `pack1` is downloaded as no version is specified. Version 1.2.3 of `pack2` is downloaded, as well as the latest version of `pack3` that is compatible with version 1.2.3.
|
||||
|
||||
{% raw %}
|
||||
``` yaml
|
||||
- uses: github/codeql-action/init@v1
|
||||
- uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
# Comma-separated list of packs to download
|
||||
packs: scope/pack1,scope/pack2@1.2.3,scope/pack3@~1.2.3
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
### Using queries in QL packs
|
||||
{% endif %}
|
||||
To add one or more queries, add a `with: queries:` entry within the `uses: github/codeql-action/init@v1` section of the workflow. If the queries are in a private repository, use the `external-repository-token` parameter to specify a token that has access to checkout the private repository.
|
||||
To add one or more queries, add a `with: queries:` entry within the `uses: {% data reusables.actions.action-codeql-action-init %}` section of the workflow. If the queries are in a private repository, use the `external-repository-token` parameter to specify a token that has access to checkout the private repository.
|
||||
|
||||
{% raw %}
|
||||
``` yaml
|
||||
- uses: github/codeql-action/init@v1
|
||||
- uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
queries: COMMA-SEPARATED LIST OF PATHS
|
||||
# Optional. Provide a token to access queries stored in private repositories.
|
||||
external-repository-token: ${{ secrets.ACCESS_TOKEN }}
|
||||
external-repository-token: {% raw %}${{ secrets.ACCESS_TOKEN }}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
You can also specify query suites in the value of `queries`. Query suites are collections of queries, usually grouped by purpose or language.
|
||||
|
||||
@@ -365,13 +357,13 @@ If you also use a configuration file for custom settings, any additional {% if c
|
||||
In the following example, the `+` symbol ensures that the specified additional {% if codeql-packs %}packs and {% endif %}queries are used together with any specified in the referenced configuration file.
|
||||
|
||||
``` yaml
|
||||
- uses: github/codeql-action/init@v1
|
||||
- uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
config-file: ./.github/codeql/codeql-config.yml
|
||||
queries: +security-and-quality,octo-org/python-qlpack/show_ifs.ql@main
|
||||
{%- if codeql-packs %}
|
||||
packs: +scope/pack1,scope/pack2@v1.2.3
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
```
|
||||
|
||||
## Using a custom configuration file
|
||||
@@ -381,7 +373,7 @@ A custom configuration file is an alternative way to specify additional {% if co
|
||||
In the workflow file, use the `config-file` parameter of the `init` action to specify the path to the configuration file you want to use. This example loads the configuration file _./.github/codeql/codeql-config.yml_.
|
||||
|
||||
``` yaml
|
||||
- uses: github/codeql-action/init@v1
|
||||
- uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
config-file: ./.github/codeql/codeql-config.yml
|
||||
```
|
||||
@@ -390,13 +382,11 @@ In the workflow file, use the `config-file` parameter of the `init` action to sp
|
||||
|
||||
If the configuration file is located in an external private repository, use the `external-repository-token` parameter of the `init` action to specify a token that has access to the private repository.
|
||||
|
||||
{% raw %}
|
||||
```yaml
|
||||
- uses: github/codeql-action/init@v1
|
||||
- uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
external-repository-token: ${{ secrets.ACCESS_TOKEN }}
|
||||
external-repository-token: {% raw %}${{ secrets.ACCESS_TOKEN }}{% endraw %}
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
The settings in the configuration file are written in YAML format.
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ If your repository contains multiple compiled languages, you can specify languag
|
||||
```yaml
|
||||
- if: matrix.language == 'cpp' || matrix.language == 'csharp'
|
||||
name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
uses: {% data reusables.actions.action-codeql-action-autobuild %}
|
||||
|
||||
- if: matrix.language == 'java'
|
||||
name: Build Java
|
||||
|
||||
@@ -167,6 +167,14 @@ Alerts may be fixed in one branch but not in another. You can use the "Branch" f
|
||||
{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %}
|
||||
{% data reusables.code-scanning.filter-non-default-branches %}
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghes > 3.4 or ghae-issue-6251 or ghec %}
|
||||
{% note %}
|
||||
|
||||
**Note:** If you run code scanning using multiple configurations, then sometimes an alert will have multiple analysis origins. Unless you run all configurations regularly, you may see alerts that are fixed in one analysis origin but not in another. For more information, see "[About analysis origins](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/about-code-scanning-alerts#about-analysis-origins)."
|
||||
|
||||
{% endnote %}
|
||||
{% endif %}
|
||||
## Dismissing or deleting alerts
|
||||
|
||||
There are two ways of closing an alert. You can fix the problem in the code, or you can dismiss the alert. Alternatively, if you have admin permissions for the repository, you can delete alerts. Deleting alerts is useful in situations where you have set up a {% data variables.product.prodname_code_scanning %} tool and then decided to remove it, or where you have configured {% data variables.product.prodname_codeql %} analysis with a larger set of queries than you want to continue using, and you've then removed some queries from the tool. In both cases, deleting alerts allows you to clean up your {% data variables.product.prodname_code_scanning %} results. You can delete alerts from the summary list within the **Security** tab.
|
||||
|
||||
@@ -82,9 +82,9 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Initialize {% data variables.product.prodname_codeql %}
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
languages: {% raw %}${{ matrix.language }}{% endraw %}
|
||||
- name: Build
|
||||
@@ -92,5 +92,5 @@ jobs:
|
||||
./configure
|
||||
make
|
||||
- name: Perform {% data variables.product.prodname_codeql %} Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
uses: {% data reusables.actions.action-codeql-action-analyze %}
|
||||
```
|
||||
|
||||
@@ -33,6 +33,10 @@ You decide how to generate {% data variables.product.prodname_code_scanning %} a
|
||||
|
||||
{% data reusables.code-scanning.enabling-options %}
|
||||
|
||||
{% ifversion fpt or ghes > 3.4 or ghae-issue-6251 or ghec %}
|
||||
{% data reusables.code-scanning.about-analysis-origins-link %}
|
||||
{% endif %}
|
||||
|
||||
{% ifversion ghes or ghae %}
|
||||
{% note %}
|
||||
|
||||
|
||||
@@ -51,10 +51,11 @@ Puedes obtener artefactos para que te ayuden a depurar {% data variables.product
|
||||
|
||||
```yaml
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
debug: true
|
||||
```
|
||||
|
||||
Los artefactos de depuración se cargarán a la ejecución de flujo de trabajo como un artefacto de nombre `debug-artifacts`. Los datos contienen las bitácoras de {% data variables.product.prodname_codeql %}. la(s) base(s) de datos de {% data variables.product.prodname_codeql %} y cualquier archivo SARIF que produzca el flujo de trabajo.
|
||||
|
||||
Estos artefactos te ayudarán a depurar los problemas con el escaneo de código de {% data variables.product.prodname_codeql %}. Si contactas al soporte de GitHub, podrían pedirte estos datos.
|
||||
@@ -86,7 +87,7 @@ Si una compilación automática de código para un lenguaje compilado dentro de
|
||||
steps:
|
||||
...
|
||||
- name: Initialize {% data variables.product.prodname_codeql %}
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
languages: {% raw %}${{ matrix.language }}{% endraw %}
|
||||
```
|
||||
@@ -150,7 +151,7 @@ Podrías entender por qué algunos archivos de código fuente no se ha analizado
|
||||
|
||||
```yaml
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
with:
|
||||
debug: true
|
||||
```
|
||||
@@ -292,11 +293,11 @@ La sección revisada de `steps` en el flujo de trabajo se deberá ver así:
|
||||
```yaml
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
# Initializes the {% data variables.product.prodname_codeql %} tools for scanning.
|
||||
- name: Initialize {% data variables.product.prodname_codeql %}
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: {% data reusables.actions.action-codeql-action-init %}
|
||||
|
||||
...
|
||||
```
|
||||
|
||||
@@ -28,6 +28,10 @@ As an alternative to running {% data variables.product.prodname_code_scanning %}
|
||||
|
||||
If you use a third-party static analysis tool that can produce results as Static Analysis Results Interchange Format (SARIF) 2.1.0 data, you can upload this to {% data variables.product.prodname_dotcom %}. For more information, see "[Uploading a SARIF file to GitHub](/code-security/secure-coding/uploading-a-sarif-file-to-github)."
|
||||
|
||||
{% ifversion fpt or ghes > 3.4 or ghae-issue-6251 or ghec %}
|
||||
{% data reusables.code-scanning.about-analysis-origins-link %}
|
||||
{% endif %}
|
||||
|
||||
## Integrations with webhooks
|
||||
|
||||
You can use {% data variables.product.prodname_code_scanning %} webhooks to build or set up integrations, such as [{% data variables.product.prodname_github_apps %}](/apps/building-github-apps/) or [{% data variables.product.prodname_oauth_apps %}](/apps/building-oauth-apps/), that subscribe to {% data variables.product.prodname_code_scanning %} events in your repository. For example, you could build an integration that creates an issue on {% data variables.product.product_name %} or sends you a Slack notification when a new {% data variables.product.prodname_code_scanning %} alert is added in your repository. For more information, see "[Creating webhooks](/developers/webhooks-and-events/creating-webhooks)" and "[Webhook events and payloads](/developers/webhooks-and-events/webhook-events-and-payloads#code_scanning_alert)."
|
||||
|
||||
@@ -94,9 +94,9 @@ jobs:
|
||||
steps:
|
||||
# This step checks out a copy of your repository.
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Upload SARIF file
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
uses: {% data reusables.actions.action-codeql-action-upload-sarif %}
|
||||
with:
|
||||
# Path to SARIF file relative to the root of the repository
|
||||
sarif_file: results.sarif
|
||||
@@ -133,7 +133,7 @@ jobs:
|
||||
actions: read
|
||||
contents: read{% endif %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Run npm install
|
||||
run: npm install
|
||||
# Runs the ESlint code analysis
|
||||
@@ -141,7 +141,7 @@ jobs:
|
||||
# eslint exits 1 if it finds anything to report
|
||||
run: node_modules/.bin/eslint build docs lib script spec-main -f node_modules/@microsoft/eslint-formatter-sarif/sarif.js -o results.sarif || true
|
||||
# Uploads results.sarif to GitHub repository using the upload-sarif action
|
||||
- uses: github/codeql-action/upload-sarif@v1
|
||||
- uses: {% data reusables.actions.action-codeql-action-upload-sarif %}
|
||||
with:
|
||||
# Path to SARIF file relative to the root of the repository
|
||||
sarif_file: results.sarif
|
||||
|
||||
@@ -37,6 +37,10 @@ redirect_from:
|
||||
|
||||
{% data reusables.code-scanning.codeql-cli-context-for-third-party-tools %}
|
||||
|
||||
{% ifversion fpt or ghes > 3.4 or ghae-issue-6251 or ghec %}
|
||||
{% data reusables.code-scanning.about-analysis-origins-link %}
|
||||
{% endif %}
|
||||
|
||||
{% data reusables.code-scanning.upload-sarif-ghas %}
|
||||
|
||||
## About the {% data variables.product.prodname_codeql_cli %}
|
||||
|
||||
@@ -6,7 +6,7 @@ redirect_from:
|
||||
- /github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository
|
||||
- /code-security/supply-chain-security/viewing-and-updating-vulnerable-dependencies-in-your-repository
|
||||
- /code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/viewing-and-updating-vulnerable-dependencies-in-your-repository
|
||||
permissions: Repository administrators and organization owners can view and update dependencies.
|
||||
permissions: 'Repository administrators and organization owners can view and update dependencies, as well as users and teams with explicit access.'
|
||||
shortTitle: View Dependabot alerts
|
||||
versions:
|
||||
fpt: '*'
|
||||
|
||||
@@ -82,8 +82,6 @@ Si tienes un flujo de trabajo que se activará mediante el {% data variables.pro
|
||||
|
||||
Para acceder a un registro de contenedor privado en AWS con un nombre de usuario y contraseña, un flujo de trabajo deberá incluir un secreto para el `username` y la `password`. En el siguiente ejemplo, cuando el {% data variables.product.prodname_dependabot %} activa el flujo de trabajo, se utilizan los secretos del {% data variables.product.prodname_dependabot %} con los nombres `READONLY_AWS_ACCESS_KEY_ID` y `READONLY_AWS_ACCESS_KEY`. Si otro actor activa el flujo de trabajo, se utilizarán los secretos de las acciones con estos nombres.
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
name: CI
|
||||
on:
|
||||
@@ -95,21 +93,19 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Login to private container registry for dependencies
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: https://1234567890.dkr.ecr.us-east-1.amazonaws.com
|
||||
username: ${{ secrets.READONLY_AWS_ACCESS_KEY_ID }}
|
||||
password: ${{ secrets.READONLY_AWS_ACCESS_KEY }}
|
||||
username: {% raw %}${{ secrets.READONLY_AWS_ACCESS_KEY_ID }}{% endraw %}
|
||||
password: {% raw %}${{ secrets.READONLY_AWS_ACCESS_KEY }}{% endraw %}
|
||||
|
||||
- name: Build the Docker image
|
||||
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% ifversion ghes = 3.3 %}
|
||||
@@ -128,8 +124,6 @@ Si tu flujo de trabajo necesita acceso a los secretos o a un `GITHUB_TOKEN` con
|
||||
|
||||
Debajo hay un ejemplo simple de un flujo de trabajo de una `pull_request` que podría estar fallando ahora:
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
### This workflow now has no secrets and a read-only token
|
||||
name: Dependabot Workflow
|
||||
@@ -140,13 +134,11 @@ jobs:
|
||||
dependabot:
|
||||
runs-on: ubuntu-latest
|
||||
# Always check the actor is Dependabot to prevent your workflow from failing on non-Dependabot PRs
|
||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
if: {% raw %}${{ github.actor == 'dependabot[bot]' }}{% endraw %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
Puedes reemplazar a `pull_request` con `pull_request_target`, el cual se utiliza para las solicitudes de cambio de las bifurcaciones y revisar explícitamente el `HEAD` de la solicitud de cambios.
|
||||
|
||||
{% warning %}
|
||||
@@ -155,8 +147,6 @@ Puedes reemplazar a `pull_request` con `pull_request_target`, el cual se utiliza
|
||||
|
||||
{% endwarning %}
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
### This workflow has access to secrets and a read-write token
|
||||
name: Dependabot Workflow
|
||||
@@ -169,17 +159,15 @@ permissions:
|
||||
jobs:
|
||||
dependabot:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||
if: {% raw %}${{ github.actor == 'dependabot[bot]' }}{% endraw %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
with:
|
||||
# Check out the pull request HEAD
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
ref: {% raw %}${{ github.event.pull_request.head.sha }}{% endraw %}
|
||||
github-token: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
También se recomienda fuertemente que bajes el alcance de los permisos que otorgas al `GITHUB_TOKEN` para poder evitar que se fugue un token con más privilegios de lo necesario. Para obtener más información, consulta ña sección "[Permisos del `GITHUB_TOKEN`](/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token)".
|
||||
|
||||
### Manejar eventos `push`
|
||||
|
||||
@@ -133,13 +133,14 @@ For more information, see "[Managing security and analysis settings for your org
|
||||
{% data variables.product.prodname_code_scanning_capc %} is configured at the repository level. For more information, see "[Setting up {% data variables.product.prodname_code_scanning %} for a repository](/code-security/secure-coding/setting-up-code-scanning-for-a-repository)."
|
||||
|
||||
## Next steps
|
||||
{% ifversion fpt or ghes > 3.1 or ghec %}You can view, filter, and sort security alerts for repositories owned by your organization in the security overview. For more information, see "[About the security overview](/code-security/security-overview/about-the-security-overview)."{% endif %}
|
||||
|
||||
You can view and manage alerts from security features to address dependencies and vulnerabilities in your code. For more information, see {% ifversion fpt or ghes or ghec %} "[Viewing {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies](/code-security/supply-chain-security/viewing-and-updating-vulnerable-dependencies-in-your-repository),"{% endif %} {% ifversion fpt or ghec or ghes > 3.2 %}"[Managing pull requests for dependency updates](/code-security/supply-chain-security/managing-pull-requests-for-dependency-updates)," {% endif %}"[Managing {% data variables.product.prodname_code_scanning %} for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository)," and "[Managing alerts from {% data variables.product.prodname_secret_scanning %}](/code-security/secret-security/managing-alerts-from-secret-scanning)."
|
||||
|
||||
{% ifversion fpt or ghec %}If you have a security vulnerability, you can create a security advisory to privately discuss and fix the vulnerability. For more information, see "[About {% data variables.product.prodname_security_advisories %}](/code-security/security-advisories/about-github-security-advisories)" and "[Creating a security advisory](/code-security/security-advisories/creating-a-security-advisory)."
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghes > 3.1 or ghec or ghae-issue-4554 %}{% ifversion ghes > 3.1 or ghec or ghae-issue-4554 %}You{% elsif fpt %}Organizations that use {% data variables.product.prodname_ghe_cloud %}{% endif %} can view, filter, and sort security alerts for repositories owned by {% ifversion ghes > 3.1 or ghec or ghae-issue-4554 %}your{% elsif fpt %}their{% endif %} organization in the security overview. For more information, see{% ifversion ghes or ghec or ghae-issue-4554 %} "[About the security overview](/code-security/security-overview/about-the-security-overview)."{% elsif fpt %} "[About the security overview](/enterprise-cloud@latest/code-security/security-overview/about-the-security-overview)" in the {% data variables.product.prodname_ghe_cloud %} documentation.{% endif %}{% endif %}
|
||||
|
||||
|
||||
{% ifversion ghec %}
|
||||
## Further reading
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Mantener los secretos seguros con el escaneo de secretos
|
||||
shortTitle: Escaneo de secretos
|
||||
intro: 'Permite que {% data variables.product.company_short %} haga el trabajo duro de asegurarse que los tokens, llaves privadas y otros secretos de código no estén expuestos en tu repositorio.'
|
||||
product: '{% data reusables.gated-features.secret-scanning %}'
|
||||
product: '{% data reusables.gated-features.secret-scanning-partner %}'
|
||||
redirect_from:
|
||||
- /code-security/secret-security
|
||||
versions:
|
||||
|
||||
@@ -26,8 +26,9 @@ shortTitle: Acerca del resumen de seguridad
|
||||
|
||||
## Acerca del resumen de seguridad
|
||||
|
||||
Puedes utilizar el resumen de seguirdad para tener una vista de nivel alto del estado de seguridad de tu organización o para identificar repositorios problemáticos que requieren intervención. Puedes ver la información de seguridad agregada o específica del repositorio en el resumen de seguridad. También puedes utilizar el resumen de seguridad para ver qué características de seguridad se habilitaron para tus repositorios y configurar cualquier característica de seguridad disponible que no se encuentre en uso actualmente.
|
||||
{% ifversion ghes or ghec or ghae %}You{% elsif fpt %}Organizations that use {% data variables.product.prodname_ghe_cloud %}{% endif %} can use the security overview for a high-level view of the security status of {% ifversion ghes or ghec or ghae %}your {% elsif fpt %}their{% endif %} organization or to identify problematic repositories that require intervention. {% ifversion ghes or ghec or ghae %}You {% elsif fpt %}These organizations{% endif %} can view aggregate or repository-specific security information in the security overview. {% ifversion ghes or ghec or ghae %}You {% elsif fpt %} Organizations that use {% data variables.product.prodname_ghe_cloud %}{% endif %} can also use the security overview to see which security features are enabled for {% ifversion ghes or ghec or ghae %}your {% elsif fpt %}their {% endif %} repositories and to configure any available security features that are not currently in use. {% ifversion fpt %}For more information, see [the {% data variables.product.prodname_ghe_cloud %} documentation](/enterprise-cloud@latest/code-security/security-overview/about-the-security-overview).{% endif %}
|
||||
|
||||
{% ifversion ghec or ghes or ghae %}
|
||||
El resumen de seguridad indica si están habilitadas las características de {% ifversion fpt or ghes > 3.1 or ghec %}seguridad{% endif %}{% ifversion ghae %}{% data variables.product.prodname_GH_advanced_security %}{% endif %} para los repositorios que pertenecen a tu organización y consolida las alertas para cada característica.{% ifversion fpt or ghes > 3.1 or ghec %} Las características de seguridad incluyen características de la {% data variables.product.prodname_GH_advanced_security %}, tales como el {% data variables.product.prodname_code_scanning %} y el {% data variables.product.prodname_secret_scanning %}, tanto como las {% data variables.product.prodname_dependabot_alerts %}.{% endif %} Para obtener más información sobre las características de la {% data variables.product.prodname_GH_advanced_security %}, consulta la sección "[Acerca de la {% data variables.product.prodname_GH_advanced_security %}](/get-started/learning-about-github/about-github-advanced-security)".{% ifversion fpt or ghes > 3.1 or ghec %} Para obtener más información sobre las {% data variables.product.prodname_dependabot_alerts %}, consulta la sección "[Acerca de las {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/about-alerts-for-vulnerable-dependencies#dependabot-alerts-for-vulnerable-dependencies)".{% endif %}
|
||||
|
||||
Para obtener más información sobre cómo proteger tu código a nivel de repositorio u organización, consulta las secciones "[Proteger tu repositorio](/code-security/getting-started/securing-your-repository)" y "[Proteger tu organización](/code-security/getting-started/securing-your-organization)".
|
||||
@@ -77,6 +78,4 @@ A nivel empresarial, el resumen de seguridad muestra información agregada y esp
|
||||
|
||||
### Acerca del resumen de seguridad a nivel de equipo
|
||||
A nivel de equipo, el resumen de seguridad muestra la información de seguridad específica del repositorio para aquellos en los que el equipo tenga privilegios de administración. Para obtener más información, consulta la sección "[Administrar el acceso de un equipo a un repositorio organizacional](/organizations/managing-access-to-your-organizations-repositories/managing-team-access-to-an-organization-repository)".
|
||||
|
||||
### Acerca del resumen de seguridad a nivel de repositorio
|
||||
A nivel de repositorio, el resumen de seguridad muestra qué características de seguridad se habilitan para el repositorio y ofrece la opción de configurar cualquier característica de seguridad que no se encuentre habilitada actualmente.
|
||||
{% endif %}
|
||||
|
||||
@@ -4,7 +4,6 @@ intro: Utiliza filtros para ver categorías específicas de las alertas
|
||||
permissions: Organization owners and security managers can access the security overview for organizations. Members of a team can see the security overview for repositories that the team has admin privileges for.
|
||||
product: '{% data reusables.gated-features.security-center %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghae: issue-4554
|
||||
ghes: '>3.1'
|
||||
ghec: '*'
|
||||
@@ -53,7 +52,7 @@ Disponible en el resumen a nivel de organización y de equipo.
|
||||
| Qualifier | Descripción |
|
||||
| --------- | ----------- |
|
||||
| | |
|
||||
{%- ifversion fpt or ghes or ghec %}
|
||||
{%- ifversion ghes or ghec %}
|
||||
| `is:public` | Muestra los repositorios públicos. |
|
||||
{%- endif %}
|
||||
{%- ifversion ghes or ghec or ghae %}
|
||||
@@ -122,11 +121,10 @@ Disponible en las vistas de alertas del escaneo de código. Todas las alertas de
|
||||
|
||||
Disponible en las vistas de alerta del escaneo de secretos.
|
||||
|
||||
| Qualifier | Descripción |
|
||||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `secret-type:SERVICE_PROVIDER` | Muestra alertas para el secreto y proveedor especificados. Para obtener más información, consulta la sección "[patrones de {% data variables.product.prodname_secret_scanning_caps %}](/code-security/secret-scanning/secret-scanning-patterns)". |
|
||||
| `secret-type:CUSTOM-PATTERN` | Muestra alertas para los secretos que coinciden con el patrón personalizado específico. |
|
||||
| {% ifversion not fpt %}Para obtener más información, consulta la sección "[Definir patrones personalizados para el escaneo de secretos](/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning)".{% endif %} | |
|
||||
| Qualifier | Descripción |
|
||||
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `secret-type:SERVICE_PROVIDER` | Muestra alertas para el secreto y proveedor especificados. Para obtener más información, consulta la sección "[patrones de {% data variables.product.prodname_secret_scanning_caps %}](/code-security/secret-scanning/secret-scanning-patterns)". |
|
||||
| `secret-type:CUSTOM-PATTERN` | Muestra alertas para los secretos que coinciden con el patrón personalizado específico. For more information, see "[Defining custom patterns for secret scanning](/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning)." |
|
||||
|
||||
## Filtrar por proveedor
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ intro: Navegar a las diversas vistas disponibles en el resumen de seguridad
|
||||
permissions: Organization owners and security managers can access the security overview for organizations. Members of a team can see the security overview for repositories that the team has admin privileges for.
|
||||
product: '{% data reusables.gated-features.security-center %}'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghae: issue-5503
|
||||
ghes: '>3.1'
|
||||
ghec: '*'
|
||||
|
||||
@@ -87,9 +87,11 @@ You can use your selected dotfiles repository to personalize your {% data variab
|
||||
|
||||
You can add further script, preferences, configuration files to your dotfiles repository or edit existing files whenever you want. Changes to settings will only be picked up by new codespaces.
|
||||
|
||||
If your codespace fails to pick up configuration settings from dotfiles, see "[Troubleshooting dotfiles for {% data variables.product.prodname_codespaces %}](/codespaces/troubleshooting/troubleshooting-dotfiles-for-codespaces)."
|
||||
|
||||
## Other available settings
|
||||
|
||||
You can also personalize {% data variables.product.prodname_codespaces %} using additional [Codespaces settings](https://github.com/settings/codespaces):
|
||||
You can also personalize {% data variables.product.prodname_codespaces %} using additional [{% data variables.product.prodname_codespaces %} settings](https://github.com/settings/codespaces):
|
||||
|
||||
- To set your default region, see "[Setting your default region for {% data variables.product.prodname_codespaces %}](/codespaces/managing-your-codespaces/setting-your-default-region-for-codespaces)."
|
||||
- To set your editor, see "[Setting your default editor for {% data variables.product.prodname_codespaces %}](/codespaces/managing-your-codespaces/setting-your-default-editor-for-codespaces)."
|
||||
|
||||
@@ -117,7 +117,7 @@ $ git clone git@{% ifversion fpt or ghec %}github.com{% else %}my-GHE-hostname.c
|
||||
|
||||
Si tu servidor necesita acceder a repositorios a lo largo de una o más organizaciones, puedes utilizar una GitHub app para definir el acceso que necesitas y luego generar tokens de _alcance limitado_ de _servidor a servidor_ desde dicha GitHub App. Se puede ajustar el alcance de los tokens de servidor a servidor para repositorios múltiples y pueden tener permisos específicos. Por ejemplo, puedes generar un token con acceso de solo lectura al contenido de un repositorio.
|
||||
|
||||
Ya que las GitHub Apps son un actor de primera clase en {% data variables.product.product_name %}, los tokens de servidor a servidor se desacoplan de cualquier usuario de GitHub, lo cual los hace comparables con los "tokens de servicio". Adicionalmente, los tokens de servidor a servidor. tienen límites de tasa dedicados que se escalan de acuerdo con el tamaño de las organizaciones sobre las cuales actúan. Para obtener más información, consulta la sección [Límites de tasa para las GitHub Apps](/developers/apps/rate-limits-for-github-apps).
|
||||
Ya que las GitHub Apps son un actor de primera clase en {% data variables.product.product_name %}, los tokens de servidor a servidor se desacoplan de cualquier usuario de GitHub, lo cual los hace comparables con los "tokens de servicio". Adicionalmente, los tokens de servidor a servidor. tienen límites de tasa dedicados que se escalan de acuerdo con el tamaño de las organizaciones sobre las cuales actúan. For more information, see [Rate limits for {% data variables.product.prodname_github_apps %}](/developers/apps/rate-limits-for-github-apps).
|
||||
|
||||
#### Pros
|
||||
|
||||
|
||||
@@ -1241,12 +1241,35 @@ Este evento ocurre cuando una {% data variables.product.prodname_github_app %} e
|
||||
{{ webhookPayloadsForCurrentVersion.secret_scanning_alert.reopened }}
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghes > 3.4 or ghec or ghae-issue-6581 %}
|
||||
## secret_scanning_alert_location
|
||||
|
||||
{% data reusables.webhooks.secret_scanning_alert_location_event_short_desc %}
|
||||
|
||||
### Disponibilidad
|
||||
|
||||
- Webhooks de repositorio
|
||||
- Webhooks de organización
|
||||
- Las {% data variables.product.prodname_github_apps %} con el permiso de `secret_scanning_alerts:read`
|
||||
|
||||
### Objeto de carga útil del webhook
|
||||
|
||||
{% data reusables.webhooks.secret_scanning_alert_location_event_properties %}
|
||||
{% data reusables.webhooks.repo_desc %}
|
||||
{% data reusables.webhooks.org_desc %}
|
||||
{% data reusables.webhooks.app_desc %}
|
||||
|
||||
### Ejemplo de carga útil del webhook
|
||||
|
||||
{{ webhookPayloadsForCurrentVersion.secret_scanning_alert_location.created }}
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghes or ghec %}
|
||||
## security_advisory
|
||||
|
||||
La actividad relacionada con una asesoría de seguridad que revisó {% data variables.product.company_short %}. Una asesoría de seguridad que haya revisado {% data variables.product.company_short %} proporciona información sobre las vulnerabilidades relacionadas con la seguridad en el software de {% data variables.product.prodname_dotcom %}.
|
||||
|
||||
El conjunto de datos de asesoría de seguridad también impulsa las {% data variables.product.prodname_dependabot_alerts %} de GitHub. Para obtener más información, consulta la sección "[Acerca de{% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies/)".
|
||||
El conjunto de datos de asesoría de seguridad también impulsa las {% data variables.product.prodname_dependabot_alerts %} de GitHub. Para obtener más información, consulta la sección "[Acerca de las {% data variables.product.prodname_dependabot_alerts %}](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies/)".
|
||||
|
||||
### Disponibilidad
|
||||
|
||||
|
||||
@@ -15,15 +15,29 @@ topics:
|
||||
|
||||
## About insights
|
||||
|
||||
You can use insights to view and customize charts that use the items added to your project as their source data. The default "Burn up" chart shows item status over time, allowing you to visualize progress. You can apply filters to the default chart and also customize and save charts that are available to everyone that can view the project.
|
||||
You can use insights to view and customize charts that use the items added to your project as their source data. The default "Burn up" chart shows item status over time, allowing you to visualize progress and spot patterns over time.
|
||||
|
||||

|
||||
|
||||
You can apply filters to the default chart and also create your own charts. When you create a chart, you set the filters, chart type, and the information displayed, and the chart is available to anyone that can view the project.
|
||||
|
||||

|
||||
|
||||
## Creating a chart
|
||||
|
||||
1. Navegar a tu proyecto.
|
||||
2. In the top-right, click {% octicon "graph" aria-label="the graph icon" %} to access insights. This feature is currently in a private preview and is not yet available to all organizations. If insights is not yet enabled for your organization, the {% octicon "graph" aria-label="the graph icon" %} icon will not be available.
|
||||
{% data reusables.projects.access-insights %}
|
||||
3. In the menu on the left, click **New chart**.
|
||||
4. Optionally, to change the name of the new chart, click {% octicon "triangle-down" aria-label="The triangle icon" %}, type a new name, and press <kbd>Return</kbd>.
|
||||
5. Above the chart, type filters to change the data used to build the chart. Para obtener más información, consulta la sección "[Filtrar proyectos](/issues/trying-out-the-new-projects-experience/filtering-projects)".
|
||||
6. To the right of the filter text box, click **Save changes**.
|
||||
|
||||
## Configuring a chart
|
||||
|
||||
{% data reusables.projects.access-insights %}
|
||||
1. In the menu on the left, click on the chart you would like to configure.
|
||||
1. On the right side of the page, click **Configure**. A panel will open on the right.
|
||||
2. To change the type of chart, select the **Layout** dropdown and click on the chart type you want to use.
|
||||
3. To change the field used for your chart's X-axis, select the **X-axis** dropdown and click the field you want to use. If you select "Time", "Group by" will change to "Status" and "Y-Axis" will change to "Count of items."
|
||||
4. Optionally, to group the items on your X-axis by another field, select **Group by** and click on the field you want to use, or click "None" to disable grouping.
|
||||
5. Optionally, if your project contains number fields and you want the Y-axis to display the sum, average, minimum, or maximum of one of those number fields, select **Y-axis** and click an option. Then, select the dropdown that appears beneath and click on the number field you want to use.
|
||||
6. To save your chart, click **Save changes**.
|
||||
|
||||
@@ -107,3 +107,4 @@ El borrar una etiqueta la eliminará de las propuestas y soilcitudes de cambios.
|
||||
- "[Filtrar y buscar propuestas y solicitudes de cambios](/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests)"{% ifversion fpt or ghes or ghec %}
|
||||
- "[Administrar las etiquetas predeterminadas para los repositorios de tu organización](/articles/managing-default-labels-for-repositories-in-your-organization)"{% endif %}{% ifversion fpt or ghec %}
|
||||
- "[Fomentar las contribuciones sanas a tu proyecto con etiquetas](/communities/setting-up-your-project-for-healthy-contributions/encouraging-helpful-contributions-to-your-project-with-labels)"{% endif %}
|
||||
- [Sintaxis de escritura y formato básicos](/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#using-emoji)"
|
||||
|
||||
@@ -60,7 +60,8 @@ Para buscar eventos específicos, utiliza el calificador `action` en tu consulta
|
||||
| [`marketplace_listing`](#marketplace_listing-category-actions) | Contiene todas las actividades relacionadas con el listado de apps en {% data variables.product.prodname_marketplace %}.{% endif %}{% ifversion fpt or ghes or ghec %}
|
||||
| [`members_can_create_pages`](#members_can_create_pages-category-actions) | Contiene todas las actividades relacionadas con administrar la publicación de sitios de {% data variables.product.prodname_pages %} para los repositorios en la organización. Para obtener más información, consulta la sección "[Administrar la publicación de sitios de {% data variables.product.prodname_pages %} para tu organización](/organizations/managing-organization-settings/managing-the-publication-of-github-pages-sites-for-your-organization)". |{% endif %}
|
||||
| [`org`](#org-category-actions) | Contiene actividades relacionadas con la membrecía organizacional.{% ifversion ghec %}
|
||||
| [`org_credential_authorization`](#org_credential_authorization-category-actions) | Contiene todas las actividades relacionadas con la autorización de credenciales para su uso con el inicio de sesión único de SAML. {% endif %}{% ifversion fpt or ghes or ghae or ghec %}
|
||||
| [`org_credential_authorization`](#org_credential_authorization-category-actions) | Contiene todas las actividades relacionadas con la autorización de credenciales para su uso con el inicio de sesión único de SAML. {% endif %}{% if secret-scanning-audit-log-custom-patterns %}
|
||||
| [`org_secret_scanning_custom_pattern`](#org_secret_scanning_custom_pattern-category-actions) | Contains organization-level activities related to secret scanning custom patterns. For more information, see "[Defining custom patterns for secret scanning](/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning)." |{% endif %}{% ifversion fpt or ghes or ghae or ghec %}
|
||||
| [`organization_label`](#organization_label-category-actions) | Contiene todas las actividades relacionadas con las etiquetas predeterminadas para los repositorios de tu organización.{% endif %}
|
||||
| [`oauth_application`](#oauth_application-category-actions) | Contiene todas las actividades relacionadas con las Apps de OAuth.{% ifversion fpt or ghes or ghec %}
|
||||
| [`paquetes`](#packages-category-actions) | Contiene todas las actividades relacionadas con el {% data variables.product.prodname_registry %}.{% endif %}{% ifversion fpt or ghec %}
|
||||
@@ -73,7 +74,9 @@ Para buscar eventos específicos, utiliza el calificador `action` en tu consulta
|
||||
| [`repository_content_analysis`](#repository_content_analysis-category-actions) | Contiene todas las actividades relacionadas con [habilitar o inhabilitar el uso de datos para un repositorio privado](/articles/about-github-s-use-of-your-data){% endif %}{% ifversion fpt or ghec %}
|
||||
| [`repository_dependency_graph`](#repository_dependency_graph-category-actions) | Contiene las actividades a nivel de repositorio para habilitar o inhabilitar la gráfica de dependencias para un |
|
||||
| repositorio {% ifversion fpt or ghec %}privado{% endif %}. Para obtener más información, consulta la sección "[Acerca de la gráfica de dependencias](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph)".{% endif %}{% ifversion ghes or ghae or ghec %} | |
|
||||
| [`repository_secret_scanning`](#repository_secret_scanning-category-actions) | Contiene actividades a nivel de repositorio relacionadas con el escaneo de secretos. Para obtener más información, consulta la sección "[Acerca del escaneo de secretos"](/github/administering-a-repository/about-secret-scanning). |{% endif %}{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
|
||||
| [`repository_secret_scanning`](#repository_secret_scanning-category-actions) | Contiene actividades a nivel de repositorio relacionadas con el escaneo de secretos. Para obtener más información, consulta la sección "[Acerca del escaneo de secretos"](/github/administering-a-repository/about-secret-scanning). |{% endif %}{% if secret-scanning-audit-log-custom-patterns %}
|
||||
| [`repository_secret_scanning_custom_pattern`](#respository_secret_scanning_custom_pattern-category-actions) | Contains repository-level activities related to secret scanning custom patterns. For more information, see "[Defining custom patterns for secret scanning](/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning)." |{% endif %}{% if secret-scanning-audit-log-custom-patterns %}
|
||||
| [`repository_secret_scanning_push_protection`](#respository_secret_scanning_push_protection) | Contains repository-level activities related to secret scanning custom patterns. For more information, see "[Protecting pushes with secert scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." |{% endif %}{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
|
||||
| [`repository_vulnerability_alert`](#repository_vulnerability_alert-category-actions) | Contiene todas las actividades relacionadas con [las {% data variables.product.prodname_dependabot_alerts %} para las dependencias vulnerables](/github/managing-security-vulnerabilities/about-alerts-for-vulnerable-dependencies).{% endif %}{% ifversion fpt or ghec %}
|
||||
| [`repository_vulnerability_alerts`](#repository_vulnerability_alerts-category-actions) | Contiene actividades de configuración a nivel de repositorio para las {% data variables.product.prodname_dependabot_alerts %}.{% endif %}{% ifversion ghec %}
|
||||
| [`rol`](#role-category-actions) | Contiene todas las actividades relacionadas con los [roles de repositorio personalziados](/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization).{% endif %}{% ifversion ghes or ghae or ghec %}
|
||||
@@ -456,7 +459,9 @@ Para obtener más información, consulta la sección "[Administrar la publicaci
|
||||
| `runner_group_updated` | Se activa cuando se cambia la configuración de un grupo de ejecutores auto-hospedados. Para obtener más información, consulta la sección "[Cambiar la política de acceso para un grupo de ejecutores auto-hospedados](/actions/hosting-your-own-runners/managing-access-to-self-hosted-runners-using-groups#changing-the-access-policy-of-a-self-hosted-runner-group)". |
|
||||
| `runner_group_runners_added` | Se activa cuando se agrega un ejecutor auto-hospedado a un grupo. Para obtener más información, consulta la sección [Mover un ejecutor auto-hospedado a un grupo](/actions/hosting-your-own-runners/managing-access-to-self-hosted-runners-using-groups#moving-a-self-hosted-runner-to-a-group). |
|
||||
| `runner_group_runner_removed` | Se activa cuando se utiliza la API de REST para eliminar un ejecutor auto-hospedado de un grupo. Para obtener más información, consulta la sección "[Eliminar un ejecutor auto-hospedado de un grupo en una organización](/rest/reference/actions#remove-a-self-hosted-runner-from-a-group-for-an-organization)". |
|
||||
| `runner_group_runners_updated` | Se activa cuando se actualiza la lista de miembros de un grupo de ejecutores. Para obtener más información, consulta la sección "[Configurar los ejecutores auto-hospedados en un grupo para una organización](/rest/reference/actions#set-self-hosted-runners-in-a-group-for-an-organization)". {% ifversion fpt or ghes > 3.1 or ghae or ghec %}
|
||||
| `runner_group_runners_updated` | Se activa cuando se actualiza la lista de miembros de un grupo de ejecutores. Para obtener más información, consulta la sección "[Configurar los ejecutores auto-hospedados en un grupo para una organización](/rest/reference/actions#set-self-hosted-runners-in-a-group-for-an-organization)". {% if secret-scanning-audit-log-custom-patterns %}
|
||||
| `secret_scanning_push_protection_disable` | Triggered when an organization owner or person with admin access to the organization disables push protection for secret scanning. For more information, see "[Protecting pushes with secret scanning](/enterprise-cloud@latest/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." |
|
||||
| `secret_scanning_push_protection_enable` | Triggered when an organization owner or person with admin access to the organization enables push protection for secret scanning.{% endif %}{% ifversion fpt or ghes > 3.1 or ghae or ghec %}
|
||||
| `self_hosted_runner_online` | Se activa cuando la aplicación del ejecutor se inicia. Solo se puede ver utilizando la API de REST; no está visible en la IU o en la exportación de JSON/CSV. Para obtener más información, consulta "[Comprobar el estado de un ejecutor autoalojado](/actions/hosting-your-own-runners/monitoring-and-troubleshooting-self-hosted-runners#checking-the-status-of-a-self-hosted-runner)." |
|
||||
| `self_hosted_runner_offline` | Se activa cuando se detiene la aplicación del ejecutor. Solo se puede ver utilizando la API de REST; no está visible en la IU o en la exportación de JSON/CSV. Para obtener más información, consulta la sección "[Verificar el estado de un ejecutor auto-hospedado](/actions/hosting-your-own-runners/monitoring-and-troubleshooting-self-hosted-runners#checking-the-status-of-a-self-hosted-runner)".{% endif %}{% ifversion fpt or ghes or ghec %}
|
||||
| `self_hosted_runner_updated` | Se activa cuando se actualiza la aplicación ejecutora. Se puede ver utilizando la API de REST y la IU; no se puede ver en la exportación de JSON/CSV. Para obtener más información, consulta la sección "[Acerca de los ejecutores auto-hospedados](/actions/hosting-your-own-runners/about-self-hosted-runners#about-self-hosted-runners)".{% endif %}{% ifversion fpt or ghec %}
|
||||
@@ -481,8 +486,17 @@ Para obtener más información, consulta la sección "[Administrar la publicaci
|
||||
| `deauthorized` | Se activa cuando un miembro [quita la autorización de credenciales para su uso con el inicio de sesión único de SAML](/github/authenticating-to-github/authenticating-with-saml-single-sign-on). |
|
||||
| `revoke` | Se activa cuando un propietario [revoca las credenciales autorizadas](/organizations/granting-access-to-your-organization-with-saml-single-sign-on/viewing-and-managing-a-members-saml-access-to-your-organization). |
|
||||
|
||||
{% endif %}
|
||||
{% endif %}{% if secret-scanning-audit-log-custom-patterns %}
|
||||
|
||||
### `org_secret_scanning_custom_pattern` category actions
|
||||
|
||||
| Acción | Descripción |
|
||||
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `create (crear)` | Triggered when a custom pattern is published for secret scanning in an organization. For more information, see "[Defining custom patterns for secret scanning](/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning#defining-a-custom-pattern-for-an-organization)." |
|
||||
| `actualización` | Triggered when changes to a custom pattern are saved for secret scanning in an organization. For more information, see "[Defining custom patterns for secret scanning](/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning#editing-a-custom-pattern)." |
|
||||
| `delete` | Triggered when a custom pattern is removed from secret scanning in an organization. For more information, see "[Defining custom patterns for secret scanning](/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning#removing-a-custom-pattern)." |
|
||||
|
||||
{% endif %}
|
||||
{% ifversion fpt or ghes or ghae or ghec %}
|
||||
### Acciones de la categoría `organization_label`
|
||||
|
||||
@@ -672,10 +686,29 @@ Para obtener más información, consulta la sección "[Administrar la publicaci
|
||||
{% endif %}{% ifversion ghec or ghes or ghae %}
|
||||
### Acciones de la categoría `repository_secret_scanning`
|
||||
|
||||
| Acción | Descripción |
|
||||
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `inhabilitar` | Se activa cuando un propietario de repositorio o persona con acceso administrativo a este inhabilita el escaneo de secretos para un repositorio {% ifversion ghec %}privado o interno{% endif %}. Para obtener más información, consulta la sección "[Acerca del escaneo de secretos"](/github/administering-a-repository/about-secret-scanning). |
|
||||
| `habilitar` | Se activa cuando un propietario de repositorio o persona con acceso administrativo a este habilita el escaneo de secretos para un repositorio {% ifversion ghec %}privado o interno{% endif %}. |
|
||||
| Acción | Descripción |
|
||||
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `inhabilitar` | Triggered when a repository owner or person with admin access to the repository disables secret scanning for a repository. Para obtener más información, consulta la sección "[Acerca del escaneo de secretos"](/github/administering-a-repository/about-secret-scanning). |
|
||||
| `habilitar` | Triggered when a repository owner or person with admin access to the repository enables secret scanning for a repository. |
|
||||
|
||||
{% endif %}{% if secret-scanning-audit-log-custom-patterns %}
|
||||
|
||||
### `repository_secret_scanning_custom_pattern` category actions
|
||||
|
||||
| Acción | Descripción |
|
||||
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `create (crear)` | Triggered when a custom pattern is published for secret scanning in a repository. For more information, see "[Defining custom patterns for secret scanning](/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning#defining-a-custom-pattern-for-a-repository)." |
|
||||
| `actualización` | Triggered when changes to a custom pattern are saved for secret scanning in a repository. For more information, see "[Defining custom patterns for secret scanning](/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning#editing-a-custom-pattern)." |
|
||||
| `delete` | Triggered when a custom pattern is removed from secret scanning in a repository. For more information, see "[Defining custom patterns for secret scanning](/code-security/secret-scanning/defining-custom-patterns-for-secret-scanning#removing-a-custom-pattern)." |
|
||||
|
||||
{% endif %}{% if secret-scanning-audit-log-custom-patterns %}
|
||||
|
||||
### `repository_secret_scanning_push_protection` category actions
|
||||
|
||||
| Acción | Descripción |
|
||||
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `inhabilitar` | Triggered when a repository owner or person with admin access to the repository disables secret scanning for a repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." |
|
||||
| `habilitar` | Triggered when a repository owner or person with admin access to the repository enables secret scanning for a repository. |
|
||||
|
||||
{% endif %}{% ifversion fpt or ghes or ghae-issue-4864 or ghec %}
|
||||
### acciones de la categoría `repository_vulnerability_alert`
|
||||
|
||||
@@ -41,7 +41,7 @@ Como alternativa, puedes configurar el SSO de SAML para una empresa utilizando O
|
||||
{% data reusables.saml.okta-provisioning-tab %}
|
||||
{% data reusables.saml.okta-configure-api-integration %}
|
||||
{% data reusables.saml.okta-enable-api-integration %}
|
||||
1. Da clic en **Autenticar con Github Enterprise Cloud - Ortanizaction**.
|
||||
1. Click **Authenticate with {% data variables.product.prodname_ghe_cloud %} - Organization**.
|
||||
1. A la derecha del nombre de tu organizaciòn, da clic en **Otorgar**.
|
||||
|
||||

|
||||
|
||||
@@ -102,12 +102,12 @@ jobs:
|
||||
run-npm-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: npm install and build webpack
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- uses: actions/upload-artifact@main
|
||||
- uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: webpack artifacts
|
||||
path: public/
|
||||
@@ -119,13 +119,13 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
node-version: [12.x, 14.x]
|
||||
steps: {% raw %}
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v2
|
||||
steps:
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js {% raw %}${{ matrix.node-version }}{% endraw %}
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}{% endraw %}
|
||||
- uses: actions/download-artifact@main
|
||||
node-version: {% raw %}${{ matrix.node-version }}{% endraw %}
|
||||
- uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: webpack artifacts
|
||||
path: public
|
||||
@@ -144,7 +144,7 @@ jobs:
|
||||
packages: write {% endif %}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Log in to GitHub Docker Registry
|
||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||
with:
|
||||
@@ -214,22 +214,22 @@ jobs:
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
run-npm-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: npm install and build webpack
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- uses: actions/upload-artifact@main
|
||||
- uses: {% data reusables.actions.action-upload-artifact %}
|
||||
with:
|
||||
name: webpack artifacts
|
||||
path: public/
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
<td>
|
||||
Este job instala NPM y lo utiliza para crear la app.
|
||||
@@ -238,7 +238,7 @@ run-npm-build:
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
run-npm-test:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -248,12 +248,12 @@ run-npm-test:
|
||||
os: [ubuntu-latest]
|
||||
node-version: [12.x, 14.x]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js {% raw %}${{ matrix.node-version }}{% endraw %}
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- uses: actions/download-artifact@main
|
||||
node-version: {% raw %}${{ matrix.node-version }}{% endraw %}
|
||||
- uses: {% data reusables.actions.action-download-artifact %}
|
||||
with:
|
||||
name: webpack artifacts
|
||||
path: public
|
||||
@@ -264,7 +264,7 @@ run-npm-test:
|
||||
env:
|
||||
CI: true
|
||||
```
|
||||
{% endraw %}
|
||||
|
||||
</td>
|
||||
<td>
|
||||
Este job utiliza <code>npm test</code> para probar el código. El comando <code>needs: run-npm-build</code> hace que este job dependa del job <code>run-npm-build</code>.
|
||||
@@ -534,32 +534,32 @@ jobs:
|
||||
packages: write
|
||||
contents: read{% endif %}
|
||||
|
||||
{% raw %}steps:
|
||||
- uses: actions/checkout@v2
|
||||
steps:
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
|
||||
- name: Build image
|
||||
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
|
||||
|
||||
- name: Log in to registry
|
||||
# This is where you will update the PAT to GITHUB_TOKEN
|
||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
run: echo "{% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
|
||||
IMAGE_ID=ghcr.io/{% raw %}${{ github.repository_owner }}{% endraw %}/$IMAGE_NAME
|
||||
|
||||
# Change all uppercase to lowercase
|
||||
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
|
||||
# Strip git ref prefix from version
|
||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
||||
VERSION=$(echo "{% raw %}${{ github.ref }}{% endraw %}" | sed -e 's,.*/\(.*\),\1,')
|
||||
# Strip "v" prefix from tag name
|
||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||
[[ "{% raw %}${{ github.ref }}{% endraw %}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||
# Use Docker `latest` tag convention
|
||||
[ "$VERSION" == "master" ] && VERSION=latest
|
||||
echo IMAGE_ID=$IMAGE_ID
|
||||
echo VERSION=$VERSION
|
||||
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
|
||||
docker push $IMAGE_ID:$VERSION{% endraw %}
|
||||
docker push $IMAGE_ID:$VERSION
|
||||
```
|
||||
|
||||
{% endif %}
|
||||
|
||||
@@ -61,8 +61,8 @@ En esta guía, crearás un flujo de trabajo de {% data variables.product.prodnam
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: 12
|
||||
- run: npm ci
|
||||
@@ -75,8 +75,8 @@ En esta guía, crearás un flujo de trabajo de {% data variables.product.prodnam
|
||||
packages: write
|
||||
contents: read{% endif %}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: {% ifversion ghae %}https://npm.YOUR-HOSTNAME.com/{% else %}https://npm.pkg.github.com/{% endif %}
|
||||
|
||||
@@ -70,11 +70,11 @@ jobs:
|
||||
matrix:
|
||||
node-version: [12.x, 14.x, 16.x]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v2
|
||||
- uses: {% data reusables.actions.action-checkout %}
|
||||
- name: Use Node.js {% raw %}${{ matrix.node-version }}{% endraw %}
|
||||
uses: {% data reusables.actions.action-setup-node %}
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
node-version: {% raw %}${{ matrix.node-version }}{% endraw %}
|
||||
cache: 'npm'
|
||||
- run: npm ci
|
||||
- run: npm run build --if-present
|
||||
|
||||
@@ -13,13 +13,13 @@ topics:
|
||||
|
||||
## Descripción y propósito
|
||||
|
||||
Millions of developers across the world host millions of projects—both open and closed source—on GitHub. We're fortunate to be able to play a part in enabling collaboration across the developer community every day, which is a responsibility we don’t take lightly. Together, we all have the exciting opportunity to make this a community we can be proud of.
|
||||
Millones de desarrolladores en todo el mundo hospedan millones de proyectos, tanto de código propietario como de código libre, en GitHub. We're fortunate to be able to play a part in enabling collaboration across the developer community every day, which is a responsibility we don’t take lightly. Together, we all have the exciting opportunity to make this a community we can be proud of.
|
||||
|
||||
El Foro de la Comunidad de GitHub está previsto para ser un lugar para más colaboración, apoyo y reunión de reflexión. Este es un lugar civilizado para conectarse con otros usuarios, aprender nuevas habilidades, compartir comentarios e ideas y encontrar todo el apoyo que necesitas para tus proyectos de GitHub. Al participar en esta comunidad, declaras que estás de acuerdo con los [Términos de Servicio](/github/site-policy/github-terms-of-service/) y [Políticas de uso aceptable de GitHub](/github/site-policy/github-acceptable-use-policies) que aplican a GitHub.com, así como a este Código de Conducta específico de la comunidad.
|
||||
|
||||
Con este Código de Conducta esperamos ayudarte a entender cómo colaborar mejor en el Foro de la Comunidad de GitHub, lo que puedes esperar de los moderadores y qué tipo de acciones o contenidos pueden resultar en una suspensión temporal o permanente de la participación en la Comunidad. Investigaremos cualquier reporte de abuso y podremos moderar el contenido público dentro de la Comunidad que determinemos que viola los Términos de Servicio de GitHub o de este Código de Conducta.
|
||||
|
||||
Our diverse user base brings different perspectives, ideas, and experiences, and ranges from people who created their first "Hello World" project last week to the most well-known software developers in the world. We are committed to making GitHub an environment that welcomes all the different voices and perspectives our community has to offer, while maintaining a safe place for developers to do their best work.
|
||||
Nuestra base de usuarios diversa trae perspectivas, ideas y experiencias diferentes y va desde las personas que crearon su primer proyecto de "Hello World" la semana pasada hasta los desarrolladores de software más famosos del mundo. We are committed to making GitHub an environment that welcomes all the different voices and perspectives our community has to offer, while maintaining a safe place for developers to do their best work.
|
||||
|
||||
## Compromiso
|
||||
|
||||
@@ -33,15 +33,15 @@ Lo siguiente no son normas duras y rápidas, sino ayudas al juicio humano de nue
|
||||
|
||||
### *Best Practices for Maintaining a Strong Community*
|
||||
|
||||
El propósito principal de la comunidad de GitHub es colaborar en proyectos de software. Estamos comprometidos a mantener una comunidad donde los usuarios sean libres de expresarse y desafiar las ideas de los demás, tanto técnicas como de otro tipo. At the same time, it's important that users remain respectful and allow space for others to contribute openly. In order to foster both a safe and productive environment, we encourage our community members to look to these guidelines to inform how they interact on our platform. Below, you’ll find some suggestions for how to have successful interactions as a valued member of the GitHub community.
|
||||
El propósito principal de la comunidad de GitHub es colaborar en proyectos de software. Estamos comprometidos a mantener una comunidad donde los usuarios sean libres de expresarse y desafiar las ideas de los demás, tanto técnicas como de otro tipo. Al mismo tiempo, es importante que los usuarios sigan siendo respetosos y permitan que exista un espacio para que los demás contribuyan abiertamente. Para fomentar un ambiente tanto productivo como seguro, exhortamos a nuestros miembros de la comunidad a seguir estos lineamientos para que se informen de cómo interactuar en nuestra plataforma. A continuación, encontrarás algunas sugerencias de cómo tener interacciones exitosas como un miembro valioso de la comunidad de GitHub.
|
||||
|
||||
- Engage with consideration and respect.
|
||||
|
||||
- **Be welcoming and open-minded** - New users join our community each day. Some are well-established developers, while others are just beginning. Be open to other ideas and experience levels. Make room for opinions other than your own and be welcoming to new collaborators and those just getting started.
|
||||
- **Se receptivo y de mente abierta** - Los usuarios nuevos se unen a nuestra comunidad diariamente. Some are well-established developers, while others are just beginning. Mantente abierto a otras ideas y niveles de experiencia. Permite las opiniones diferentes a la tuya y recibe a los colaboradores nuevos y a aquellos que están comenzando.
|
||||
|
||||
- **Be respectful** - Working in a collaborative environment means disagreements may happen. Pero recuerda criticar las ideas, no a las personas. Share thoughtful, constructive criticism and be courteous to those you interact with. If you’re unable to engage respectfully, consider taking a step back or using some of our moderation tools to deescalate a tense situation.
|
||||
- **Sé respetuoso** - El trabajar en un ambiente colaborativo, significa que pueden existir los desacuerdos. Pero recuerda criticar las ideas, no a las personas. Share thoughtful, constructive criticism and be courteous to those you interact with. Si no puedes participar respetuosamente, considera retirarte o utilizar alguna de nuestras herramientas de moderación para apaciguar una situación tensa.
|
||||
|
||||
- **Be empathetic** - GitHub is a global community with people from a wide variety of backgrounds and perspectives, many of which may not be your own. Try to put yourself in others’ shoes and understand their feelings before you address them. Do your best to help make GitHub a community where others feel safe to make contributions, participate in discussions, and share different ideas.
|
||||
- **Sé empático** - GitHub es una comunidad global con personas de una amplia gama de antecedentes y perspectivas, muchas de las cuales podrían no ser las mismas que las tuyas. Try to put yourself in others’ shoes and understand their feelings before you address them. Haz tu mejor esfuerzo para ayudar a que la comunidad de GitHub sea un lugar en donde todos se sientan seguros para hacer contribuciones, participar en debates y compartir ideas diferentes.
|
||||
|
||||
- Contribuye de forma positiva y constructiva.
|
||||
- **Mejorar el debate.** Ayúdanos a hacer de esto un gran lugar para el debate trabajando siempre para mejorar la discusión de alguna manera, sin embargo siempre breve. Si no estás seguro de que tu publicación sume a la conversación, piensa en lo que quieres decir e inténtalo de nuevo más tarde.
|
||||
@@ -68,35 +68,15 @@ El propósito principal de la comunidad de GitHub es colaborar en proyectos de s
|
||||
|
||||
### *Lo que no está permitido*
|
||||
|
||||
- **Amenazas de violencia.** No puede amenazar la violencia hacia otros ni utilizar el sitio para organizar, promover o incitar a actos de violencia o terrorismo en el mundo real. Piensa detenidamente en las palabras que usas, las imágenes que publicas e incluso el software que escribas y cómo lo pueden interpretar otros. Incluso si dices algo como una broma, es posible que no se reciba de esa forma. Si crees que alguien más pudiera interpretar el contenido que publicas como una amenaza, o como promoción de violencia o terrorismo, detente. No lo publiques en GitHub. En casos extraordinarios podemos denunciar amenazas de violencia a la aplicación de la ley si creemos que puede haber un verdadero riesgo de daños físicos o una amenaza para la seguridad pública.
|
||||
|
||||
- **Discriminación y discursos de odio** Si bien no está prohibido abordar temas como la edad, complexión corporal, discapacidad, etnicidad, identidad de género y expresión, nivel de experiencia, nacionalidad, apariencia personal, raza, religión e identidad y orientación sexual, no toleramos los discursos que ataquen a una persona o grupo de personas en función de quiénes son. Sólo date cuenta de que cuando se trata de una forma agresiva o insultante, estos (y otros) temas delicados pueden hacer que otros se sientan no deseados o incluso inseguros. Aunque siempre existe la posibilidad de malentendidos, esperamos que los miembros de nuestra comunidad continúen siendo respetuosos y corteses cuando discutan temas delicados.
|
||||
|
||||
- **Intimidación y acoso** No toleramos acoso ni intimidación. Esto significa cualquier acoso o intimidación habitual dirigida a una persona o grupo específico de personas. En general, si tus acciones son indeseables y continúas participando en ellas, hay una buena posibilidad de que te dirijas a territorio de intimidación o acoso.
|
||||
|
||||
**Perturbar la experiencia de otros usuarios.** El ser parte de una comunidad incluye el reconocer cómo tu comportamiento afecta a otros y participar en interacciones significativas y productivas con las personas y la plataforma de la cual dependen. No se permiten los comportamientos como el publicar comentarios fuera de tema constantemente, abrir temas vacíos o insignificantes o utilizar cualquier otra característica de la plataforma de forma que perturbe continuamente la experiencia de otros usuarios.
|
||||
|
||||
- **Personificación.** No puedes personificar a alguien más copiando su avatar, publicando contenido bajo su dirección de correo electrónico, utilizando un nombre de usuario similar o hacerte pasar por alguien más de cualquier otra forma. La suplantación es una forma de acoso.
|
||||
|
||||
- **Doxxing e invación de la privacidad.** No publiques la información personal de los demás, tal como las direcciones personales y privadas de correo electrónico, números telefónicos, direcciones físicas, números de tarjeta de crédito, números de seguridad social/identidad nacional o contraseñas. Dependiendo del contexto, como en el caso de intimidación o acoso, podemos considerar otra información, tales como fotos o vídeos que fueron tomados o distribuidos sin el consentimiento de la persona, una invasión de la privacidad, especialmente cuando dicho material representa un riesgo para la seguridad del sujeto.
|
||||
|
||||
- **Contenido sexualmente obsceno.** No publiques contenido pornográfico. Esto no significa que toda la desnudez o todo el código y contenido relacionados con la sexualidad, esté prohibido. Reconocemos que la sexualidad es parte de la vida y que el contenido sexual no pornográfico puede ser parte de su proyecto o puede presentarse con fines educativos o artísticos. No permitimos contenidos sexuales obscenos que puedan implicar la explotación o la sexualización de menores. Si tienes alguna pregunta o inquietud sobre algo que quieras publicar, [no dudes en contactar y preguntar](https://support.github.com/contact?tags=docs-policy) de antemano.
|
||||
|
||||
- **Spam.** Respeta el Foro de la Comunidad de GitHub. No publiques anuncios, enlaces a sitios web con spam, hagas ping o menciones listas largas de nombres de usuario de forma inadecuada o vandalices la comunidad de cualquier otra forma. Esta comunidad está diseñada para que los usuarios de GitHub debatan sobre proyectos, aprendan y compartan ideas entre sí - no para publicidad u otro contenido como spam. Los contenidos que consideremos spam serán eliminados. Por favor, consulta nuestras [Políticas de Uso Aceptable de GitHub](/github/site-policy/github-acceptable-use-policies#4-spam-and-inauthentic-activity-on-github) para obtener detalles adicionales sobre el spam y la actividad inauténtica.
|
||||
|
||||
- **Contenido con derechos de autor o ilegal.** Publica solo tus propias cosas. Eres responsable de lo que publicas. Si publicas algo que no te creaste, debes tener derecho a publicarlo. Ni puedes publicar contenido ilegal, incluyendo contenido ilegal bajo las leyes de copyright y marca registrada, enlaces a contenido ilegal, o métodos para eludir la ley.
|
||||
|
||||
- **Contenido injustificadamente violento.** No publiques imágenes violentas, texto o cualquier tipo de contenido sin un contexto o advertencia razonables. Si bien a menudo está bien incluir contenido violento en los videojuegos, reportes de noticias y descripciones de eventos históricos, no permitimos el contenido violento que se publica indiscriminadamente o que se hace de forma que el resto de los usuarios tengan dificultad para evadirlo (tal como en el avatar, descripción de perfil, tema o respuesta). Una clara advertencia o renuncia de responsabilidad en otros contextos ayuda a los usuarios a tomar una decisión educada sobre si quieren participar en dichos contenidos o no.
|
||||
|
||||
- **Malware activo o exploits.** El ser parte de una comunidad incluye el no aprovecharse de otros miembros de ella. No permitimos que nadie utilice nuestra plataforma para apoyar directamente los ataques ilícitos que causan daño técnico, tales como utilizar GitHub como medio para entregar ejecutables malintencionados o como infraestructura de ataque, por ejemplo, para organizar ataques de negación del servicio o administrar servidores de control y comando. Los daños técnicos significan el sobreconsumo de recursos, daño físico, tiempo de inactividad, negación del servicio o pérdidad de datos, sin propósito implícito o explícito para uso dual antes de que ocurra el abuso. Toma en cuenta que GitHub permite el contenido de uso dual y apoya la publicación de contenido que se utilice para la investigación de vulnerabilidades, malware o exploits, ya que el publicar o distribuir este tipo de contenido tiene un valor educativo y pñroporciona un beneficio real a la comunidad de seguridad. Asumimos un uso de estos proyectos e intención positivos para promover e impulsar mejoras a lo largo del ecosistema. Por favor, consulta nuestros [Lineamientos de la comunidad de GitHub](/github/site-policy/github-community-guidelines#active-malware-or-exploits) para obtener detalles completos de esta sección.
|
||||
|
||||
- **Desinformar y malinformar.** No puedes publicar contenido que presente una visión distorsionada de la realidad, ya sea inadecuado o falso (malinformación) o que engañe adrede (desinformación), ya sea que dicho contenido pueda resultar en un daño al público o interferir con las oportunidades justas e igualitarias para que todos participen en la vida pública. Por ejemplo, no permitimos contenido que pueda poner el bienestar de grupos de personas en riesgo o limitar su capacidad de participar en una sociedad libre y abierta. Fomentamos la participación activa en la expresión de ideas, perspectivas y experiencias y podríamos no estar en posición de disputar cuentas personales u observaciones. Por lo general, permitimos la parodia y la sátira que está en línea con nuestras políticas de uso aceptable y consideramos que el contexto es importante en la manera en que se recibe y se entiende la información; por lo tanto, puede ser adecuado aclarar tus intenciones mediante renuncias u otros medios, así como la fuente(s) de tu información.
|
||||
GitHub's [Acceptable Use Policies](/site-policy/acceptable-use-policies/github-acceptable-use-policies), which are part of GitHub's [Terms of Service](/github/site-policy/github-terms-of-service/), set a baseline for what is not allowed on GitHub. In addition, these terms restrictions apply to the GitHub Community Forum in the following way:
|
||||
|
||||
- **Cualquier persona menor de 13 años.** Si eres menor de 13 años, no puedes tener una cuenta en el Foro de la Comunidad de GitHub (o en el propio GitHub). GitHub no recopila intencionalmente información de niños menores de 13 años ni dirige ninguno de nuestros contenidos de manera específica a ellos. Si aprendemos o tenemos motivos para sospechar que eres un usuario menor de 13 años, desafortunadamente tendremos que cerrar tanto tu Foro de la Comunidad de GitHub como tus cuentas en GitHub.com. No queremos desalentarte de que aprendas nuestro código, pero esas son las reglas. Consulta nuestras [Términos de servicio](/github/site-policy/github-terms-of-service/) para obtener información sobre la cancelación de la cuenta.
|
||||
|
||||
- **Creating new account after account restriction.** GitHub's [Terms of Service](/github/site-policy/github-terms-of-service/) state that "One person or legal entity may maintain no more than one free Account." Additional free accounts created to inquire about flagged or suspended accounts in the GitHub Community Forum will be removed.
|
||||
|
||||
- **Otras conductas que podrían considerarse razonablemente inadecuadas en un entorno profesional.** El Foro de la Comunidad de GitHub es un espacio profesional y debe ser tratado como tal.
|
||||
|
||||
- **Violación de los Términos de Servicio.** Si se identifica a tu cuenta de Github.com por haber violado los [Términos de Servicio](/github/site-policy/github-terms-of-service/), también tendremos que cerrar tu cuenta del Foro de la Comunidad de GitHub. Los [Términos de Servicio](/github/site-policy/github-terms-of-service/) también indican que "Una persona o entidad legal no podrá mantener más de una cuenta Gratuita", por lo tanto, también se eliminarán las cuentas gratuitas adicionales que creen para preguntar sobre las cuentas marcadas o suspendidas en el foro de la comunidad.
|
||||
- **Violation of Terms of Service.** If your GitHub.com account is identified in violation of [Terms of Service](/github/site-policy/github-terms-of-service/) we will have to close your GitHub Community Forum account as well.
|
||||
|
||||
## Cumplimiento
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
#Reference: #6447
|
||||
#Versions of actions used in workflows have been updated to their Node 16 version.
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
ghes: '>=3.5'
|
||||
ghae: 'issue-6447'
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
#Reference: #6615.
|
||||
#Documentation for new audit log events for custom patterns for secret scanning.
|
||||
versions:
|
||||
ghec: '*'
|
||||
ghes: '>=3.5'
|
||||
ghae: 'issue-6615'
|
||||
@@ -0,0 +1 @@
|
||||
actions/cache@{% if actions-node16-action %}v3{% else %}v2{% endif %}
|
||||
@@ -0,0 +1 @@
|
||||
actions/checkout@{% if actions-node16-action %}v3{% else %}v2{% endif %}
|
||||
@@ -0,0 +1 @@
|
||||
github/codeql-action/analyze@{% if actions-node16-action %}v2{% else %}v1{% endif %}
|
||||
@@ -0,0 +1 @@
|
||||
github/codeql-action/autobuild@{% if actions-node16-action %}v2{% else %}v1{% endif %}
|
||||
@@ -0,0 +1 @@
|
||||
github/codeql-action/init@{% if actions-node16-action %}v2{% else %}v1{% endif %}
|
||||
@@ -0,0 +1 @@
|
||||
github/codeql-action/upload-sarif@{% if actions-node16-action %}v2{% else %}v1{% endif %}
|
||||
@@ -0,0 +1 @@
|
||||
actions/delete-package-versions@{% if actions-node16-action %}v3{% else %}v2{% endif %}
|
||||
@@ -0,0 +1 @@
|
||||
actions/download-artifact@{% if actions-node16-action %}v3{% else %}v2{% endif %}
|
||||
@@ -0,0 +1 @@
|
||||
actions/github-script@{% if actions-node16-action %}v6{% else %}v5{% endif %}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user