Skip to content

Commit 73f1290

Browse files
committed
Improve docs linked for wrapper-validation failure
1 parent b6395da commit 73f1290

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

docs/wrapper-validation.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,22 @@ We recommend the message commit contents of:
9393

9494
From there, you can easily follow the rest of the prompts to create a Pull Request against the project.
9595

96-
## Reporting Failures
96+
## Validation Failures
9797

98-
If this GitHub action fails because a `gradle-wrapper.jar` doesn't match one of our published SHA-256 checksums,
99-
we highly recommend that you reach out to us at [[email protected]](mailto:[email protected]).
98+
A wrapper jar can fail validation for a few reasons:
99+
1. The wrapper is from a snapshot build of Gradle (nightly or release nightly) and you have not set `allow-snapshots`
100+
or `allow-snapshot-wrappers` to `true`.
101+
2. The wrapper jar is from a version of Gradle with an unverifiable wrapper jar (see below).
102+
3. The wrapper jar was not published by Gradle, and could be compromised.
100103

101-
**Note:** `gradle-wrapper.jar` generated by Gradle 3.3 to 4.0 are not verifiable because those files were dynamically generated by Gradle in a non-reproducible way. It's not possible to verify the `gradle-wrapper.jar` for those versions are legitimate using a hash comparison. You should try to determine if the `gradle-wrapper.jar` was generated by one of these versions before running the build.
104+
If this GitHub action fails because a `gradle-wrapper.jar` was not published by Gradle,
105+
we highly recommend that you reach out to us at [[email protected]](mailto:[email protected]).
102106

103-
If the Gradle version in `gradle-wrapper.properties` is out of this range, you may need to regenerate the `gradle-wrapper.jar` by running `./gradlew wrapper`. If you need to use a version of Gradle between 3.3 and 4.0, you can use a newer version of Gradle to generate the `gradle-wrapper.jar`.
107+
#### Unverifiable Wrapper Jars
108+
Wrapper Jars generated by Gradle versions `3.3` to `4.0` are not verifiable because those files were dynamically generated by Gradle in a non-reproducible way. It's not possible to verify the `gradle-wrapper.jar` for those versions are legitimate using a hash comparison. If you have a validation failure, you should try to determine if the `gradle-wrapper.jar` was generated by one of these versions before running the build.
104109

105-
If you're curious and want to explore what the differences are between the `gradle-wrapper.jar` in your possession
106-
and one of our valid release, you can compare them using this online utility: [diffoscope](https://try.diffoscope.org/).
107-
Regardless of what you find, we still kindly request that you reach out to us and let us know.
110+
- If the Gradle version in `gradle-wrapper.properties` is outside of this range, you can regenerate the `gradle-wrapper.jar` by running `./gradlew wrapper`. This will generate a new, verifiable wrapper jar.
111+
- If you need to run your build with a version of Gradle between 3.3 and 4.0, you can use a newer version of Gradle to generate the `gradle-wrapper.jar`.
108112

109113
## Resources
110114

sources/src/wrapper-validation/wrapper-validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export async function validateWrappers(
3333
} else {
3434
core.info(result.toDisplayString())
3535
throw new JobFailure(
36-
`Gradle Wrapper Validation Failed!\n See https://github.com/gradle/actions/blob/main/docs/wrapper-validation.md#reporting-failures\n${result.toDisplayString()}`
36+
`Gradle Wrapper Validation Failed!\n See https://github.com/gradle/actions/blob/main/docs/wrapper-validation.md#validation-failures\n${result.toDisplayString()}`
3737
)
3838
}
3939

0 commit comments

Comments
 (0)