Skip to content

Commit

Permalink
Add options to the PR workflow to disable or invalidate the cache
Browse files Browse the repository at this point in the history
  • Loading branch information
object-Object committed Aug 26, 2024
1 parent e3f0865 commit b18e60a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: |
Expand Down

0 comments on commit b18e60a

Please sign in to comment.