actions icon indicating copy to clipboard operation
actions copied to clipboard

Automatically perform wrapper validation check in `setup-gradle`

Open bigdaz opened this issue 4 years ago • 5 comments

Currently, we recommend that users configure a separate workflow running the wrapper-validation-action to verify that the Gradle wrapper jar is not corrupted.

Doing this automatically for any workflow using setup-gradle would increase coverage of wrapper validation and reduce the complexity for users adopting Gradle with GitHub actions.

We could also leverage the wrapper-check to avoid executing an invalid wrapper jar in dependency-submission

bigdaz avatar Jan 28 '22 23:01 bigdaz

Is there any timeline on this happening?

eygraber avatar Nov 25 '22 20:11 eygraber

Currently, we recommend that users configure a separate workflow running the wrapper-validation-action to verify that the Gradle wrapper jar is not corrupted.

I would recommend adding the Gradle wrapper validation check immediately after checkout in any workflow that may run a Gradle wrapper. This eliminates the risk of potentially running a bad wrapper at all in any workflow. For example:

name: Build
on: [ push, pull_request ]

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: gradle/wrapper-validation-action@v1
      - uses: gradle/gradle-build-action@v2
      - run: ./gradlew clean build

erichaagdev avatar Mar 13 '23 23:03 erichaagdev

I think the biggest thing blocking this from happening is that currently Gradle doesn't publish wrapper SHAs for SNAPSHOT releases. As such, projects like gradle/gradle can't use the verification action because it is regularly using pre-release builds to build Gradle.

JLLeitschuh avatar Apr 04 '23 20:04 JLLeitschuh

@bigdaz this looks like it may be possible now that Gradle publishes snapshot checksums, right?

JLLeitschuh avatar Feb 03 '24 15:02 JLLeitschuh

I think the biggest thing blocking this from happening is that currently Gradle doesn't publish wrapper SHAs for SNAPSHOT releases. As such, projects like gradle/gradle can't use the verification action because it is regularly using pre-release builds to build Gradle.

If they are still not published, this could easily be mitigated by introducing a switch to disable wrapper validation for SNAPSHOT versions or completely. However, having validation enabled by default would make everyone safer.

leonard84 avatar Mar 22 '24 09:03 leonard84