Do not use `gradle/actions/setup-gradle` with `arguments`; replace with two steps
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- github-actions
- Área
- ci-cd
Línea de trabajo
Comienza localizando la receta que gestiona los pasos de gradle/actions/setup-gradle mediante el parámetro arguments y revisa las pruebas unitarias de la receta. Usa los ejemplos YAML de antes y después como la transformación esperada, incluido el manejo de build-root-directory y working-directory. Se considera terminado cuando las ejecuciones obsoletas basadas en arguments se convierten en un paso de setup seguido de pasos run para los comandos de Gradle.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What problem are you trying to solve?
Using the action to execute Gradle via the arguments parameter is deprecated
The core functionality of the setup-gradle (and gradle-build-action) actions is to configure your Gradle environment for GitHub Actions. Once the action has run, any subsequent Gradle executions will benefit from caching, reporting and other features of the action.Using the arguments parameter to execute Gradle directly is not necessary to benefit from this action. This input is deprecated, and will be removed in the v4 major release of the action.
To convert your workflows, replace any steps using the arguments parameter with 2 steps: one to setup-gradle and another that runs your Gradle build.
What precondition(s) should be checked before applying this recipe?
Uses gradle/actions/setup-gradle
Describe the situation before applying the recipe
steps:
- name: Assemble the project
uses: gradle/actions/setup-gradle@v3
with:
arguments: 'assemble'
- name: Run the tests
uses: gradle/actions/setup-gradle@v3
with:
arguments: 'test'
- name: Run build in a subdirectory
uses: gradle/actions/setup-gradle@v3
with:
build-root-directory: another-build
arguments: 'build'
Describe the situation after applying the recipe
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Assemble the project
run: ./gradlew assemble
- name: Run the tests
run: ./gradlew test
- name: Run build in a subdirectory
working-directory: another-build
run: ./gradlew build
Any additional context
Using the action in this way gives you more control over how Gradle is executed, while still giving you all of the benefits of the setup-gradle action.
The arguments parameter is scheduled to be removed in setup-gradle@v4.
Note: if you are using the gradle-build-action, see here for more details on how to migrate.
- Lenguaje dominante
- Java
- Estrellas
- 1
- Forks
- 9
- Merge medio
- 45 min
- PR fusionados (30 d)
- 7
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openrewrite/rewrite-github-actions
-
enhancement recipe
Dificultad 5/5 Más de una semana Aptitud para principiantes 48/100
openrewrite/rewrite-github-actions#195 · 1 comentario ·
-
recipe
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Use multiline in `if` statementsAbiertorecipe
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
-
enhancement recipe
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
openrewrite/rewrite-github-actions#128 · 5 comentarios ·
-
Recipe to update job triggersAbiertorecipe
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
openrewrite/rewrite-github-actions#90 · 1 reacción ·
Todos los issues de openrewrite/rewrite-github-actions
Issues similares
-
[GLOBAL] Advancement resetAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Vakore/ZappierGames#184 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
lugassawan/swe-workbench#823 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
cassiancc/Raspberry-Core#69 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
IronCoreLabs/ironcore-alloy#351 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
checkstyle/checkstyle#22145 ·
Los mantenedores suelen responder en 1 día