From b18e60a534c7be8cc53a0d2b190586743c98e328 Mon Sep 17 00:00:00 2001 From: object-Object Date: Sun, 25 Aug 2024 22:39:49 -0400 Subject: [PATCH] Add options to the PR workflow to disable or invalidate the cache --- .github/workflows/pr.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2600ad506..0126018de 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -6,6 +6,15 @@ name: Build pull request on: pull_request: workflow_dispatch: + inputs: + disable-cache: + description: Do not read from or write to the Gradle cache for this run. + type: boolean + default: false + invalidate-cache: + description: Do not read from the Gradle cache for this run, but still write to it. Should only be used on main. + type: boolean + default: false # trigger on pushes to the default branch (main) to keep the cache up to date push: branches: main @@ -25,6 +34,9 @@ jobs: distribution: temurin java-version: ${{ env.JAVA_VERSION }} - uses: gradle/actions/setup-gradle@v3 + with: + cache-disabled: ${{ inputs.disable-cache }} + cache-write-only: ${{ inputs.invalidate-cache }} - name: Build run: |