Add separate pub-cache boolean flag (#377)

This allows to selectively enabled pub dependency caching. Uses backwards compatible default if only `cache: true` is set.

Also update README
This commit is contained in:
Peter Leibiger
2026-03-18 15:31:10 +01:00
committed by GitHub
parent 6622f58c44
commit 7ff07e9ecd
2 changed files with 23 additions and 1 deletions

View File

@@ -34,6 +34,10 @@ inputs:
description: Flutter SDK cache path
required: false
default: ""
pub-cache:
description: Cache the Dart pub dependencies
required: false
default: ""
pub-cache-key:
description: Identifier for the Dart .pub-cache cache
required: false
@@ -125,7 +129,7 @@ runs:
- name: Cache pub dependencies
uses: actions/cache@v5
id: cache-pub
if: ${{ inputs.cache == 'true' }}
if: ${{ (inputs.pub-cache == '' && inputs.cache == 'true') || inputs.pub-cache == 'true' }}
with:
path: ${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}
key: ${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}-${{ hashFiles('**/pubspec.lock') }}