Specifying `gradle-version: 'wrapper'` does not cause Gradle wrapper to be used
- Dominant language
- TypeScript
- Stars
- 340
- Forks
- 117
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 11
Description
I use the `gradle/actions/setup-gradle` task with a version matrix `gradle-version: ['wrapper', '7.6.4', '8.8']`. For the `'wrapper'` value, I expected it to use the `gradlew` wrapper version of Gradle (8.6 in my case, [as documented](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#build-with-a-specific-gradle-version)). Instead, it uses a seemingly random (latest?) version of Gradle (Gradle 8.8 in my case).
For the explicitly specified versions 7.6.4 and 8.8, it works correctly, downloading and setting up that Gradle version. The subsequent call to`gradle build` executes with the intended Gradle version. However, for the `'wrapper'` version of Gradle, which is [Gradle 8.6](https://github.com/Virtlink/kotlin-jvm-template/blob/main/gradle/wrapper/gradle-wrapper.properties#L3) in my project, it instead [uses Gradle 8.8](https://github.com/Virtlink/kotlin-jvm-template/actions/runs/9741721408/job/26881500409#step:6:21).
This is the relevant part of [my workflow](https://github.com/Virtlink/kotlin-jvm-template/blob/main/.github/workflows/build.yaml):
```yaml
jobs:
build:
strategy:
matrix:
gradle-version: ['wrapper', '7.6.4', '8.8']
steps:
# ...
- name: "Setup Gradle ${{ matrix.gradle-version }}"
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{ matrix.gradle-version }}
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
build-scan-terms-of-use-agree: "yes"
- name: 'Build'
run: |
gradle build
```
Contributor guide
Assessment
This issue has not been assessed yet.