Do not use `gradle/actions/setup-gradle` with `arguments`; replace with two steps
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github-actions
- Lĩnh vực
- ci-cd
Hướng nghiên cứu
Bắt đầu bằng cách tìm recipe xử lý các bước gradle/actions/setup-gradle bằng tham số arguments và xem lại các unit test của recipe. Sử dụng các ví dụ YAML trước và sau làm phép chuyển đổi dự kiến, bao gồm cả việc xử lý build-root-directory và working-directory. Hoàn thành nghĩa là các lần thực thi dựa trên arguments đã lỗi thời được chuyển thành một bước setup, theo sau là các bước run cho các lệnh Gradle.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 1
- Fork
- 9
- Merge trung bình
- 45 phút
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của openrewrite/rewrite-github-actions
-
enhancement recipe
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 48/100
openrewrite/rewrite-github-actions#195 · 1 bình luận ·
-
recipe
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Use multiline in `if` statementsĐang mởrecipe
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
enhancement recipe
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
openrewrite/rewrite-github-actions#128 · 5 bình luận ·
-
Recipe to update job triggersĐang mởrecipe
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
openrewrite/rewrite-github-actions#90 · 1 reaction ·
Tất cả issue của openrewrite/rewrite-github-actions
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
521xueweihan/HelloGitHub#4105 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
code-maintenance
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
krizaka/krizaka-notifications#32 ·
Maintainer thường phản hồi trong vòng 1 ngày