mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
Enable wrapper validation by default
- Add 'allow-snapshot-wrappers' input parameter - Default 'validate-wrappers' to 'true' Fixes #12
This commit is contained in:
@@ -515,14 +515,30 @@ Since Gradle applies init scripts in alphabetical order, one way to ensure this
|
||||
|
||||
## Gradle Wrapper validation
|
||||
|
||||
Instead of using the [wrapper-validation action](./wrapper-validation.md) separately, you can enable
|
||||
wrapper validation directly in your Setup Gradle step.
|
||||
By default, this action will perform the same wrapper validation as is performed by the dedicated
|
||||
[wrapper-validation action](./wrapper-validation.md).
|
||||
This means that invalid wrapper jars will be automatically detected when using `setup-gradle`.
|
||||
|
||||
If you do not want wrapper-validation to occur automatically, you can disable it:
|
||||
|
||||
```yaml
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
with:
|
||||
validate-wrappers: false
|
||||
```
|
||||
|
||||
If your repository uses snapshot versions of the Gradle wrapper, such as nightly builds, then you'll need to
|
||||
explicitly allow snapshot wrappers in wrapper validation.
|
||||
These are not allowed by default.
|
||||
|
||||
|
||||
```yaml
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
with:
|
||||
validate-wrappers: true
|
||||
allow-snapshot-wrappers: true
|
||||
```
|
||||
|
||||
If you need more advanced configuration, then you're advised to continue using a separate workflow step
|
||||
|
||||
@@ -4,6 +4,9 @@ This action validates the checksums of _all_ [Gradle Wrapper](https://docs.gradl
|
||||
|
||||
The action should be run in the root of the repository, as it will recursively search for any files named `gradle-wrapper.jar`.
|
||||
|
||||
The `setup-gradle` action will perform wrapper validation on each execution. If you are using `setup-gradle` in your
|
||||
workflows, it is unlikely that you will need to use this action.
|
||||
|
||||
## The Gradle Wrapper Problem in Open Source
|
||||
|
||||
The `gradle-wrapper.jar` is a binary blob of executable code that is checked into nearly
|
||||
|
||||
Reference in New Issue
Block a user