Skip to content

Do not run gradle-cache-action if project/repo does not use Gradle #102

@mkurz

Description

@mkurz

The Gradle Cache always runs, no matter if the project is using Gradle or not:
https://github.com/playframework/play-mailer/actions/runs/14854450285/job/41704377293#step:6:29

Even worse, if there is a problem, like timeout, it can take long time until the actions finishes:
https://github.com/sbt/sbt-web-build-base/actions/runs/15442013973/job/43461980655?pr=76#step:6:29

here it took more than 500 seconds...

Can we somehow skip the Gradle action with and if: ... condition? Not sure what we could use as condition, something like if repo does not contain a file named *.gradle.kts or *.gradle?

- name: Gradle Cache
uses: burrunan/gradle-cache-action@v3
with:
build-root-directory: ${{ inputs.gradle-build-root }}
# Disable caching of ~/.gradle/caches/build-cache-*
save-local-build-cache: false
# Disable caching of ~/.m2/repository/
save-maven-dependencies-cache: false

@ihostage What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions