Fix Gradle cache save races when restore hits a fallback key.

Save always uses the job scope key; do not reuse cache-primary-key from a partial restore (e.g. Android saving build-jar).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-14 16:11:33 +03:00
Unverified
parent 3416bc2b0e
commit 7d7e78c534
3 changed files with 12 additions and 12 deletions
@@ -10,9 +10,9 @@ outputs:
cache-hit:
description: Whether an exact cache key match was restored
value: ${{ steps.cache.outputs.cache-hit }}
cache-primary-key:
description: Primary cache key to pass to the save action after the build
value: ${{ steps.cache.outputs.cache-primary-key }}
cache-save-scope:
description: Scope to pass to the save action (always this job's scope, not a restored fallback key)
value: ${{ inputs.scope }}
runs:
using: composite