Repository: godotengine/godot (language: cpp)

Issue:
`Save Godot build cache` fails on forks
### Tested versions

4.5 dev ([98d5b3c10484c99f0490c8e41e5dc9b8c387843b])

### System information

N/A

### Issue description

It seems like the GitHub action `Save Godot Build Cache` fails on forks (or at least, on my fork, on branches).
This is preventing caches from establishing themselves, driving up costs for recompiles.

I'm not sure if you can access my build logs, but you can see the fail on all systems:
https://github.com/Ivorforce/godot/actions/runs/14173236379/job/39701883100

The reason seems to be that `CACHE_TIMESTAMP` is missing:
```bash
misc/scripts/purge_cache.py  "/home/runner/work/godot/godot/.scons_cache/"
usage: purge_cache.py [-h] timestamp directory
purge_cache.py: error: argument timestamp: invalid int value: '/home/runner/work/godot/godot/.scons_cache/'
```

Which in turn probably happens because the restore failed:
```
Cache not found for input keys: linux-template-mono|master|0ba487978671e046b63821dc0afb129f3e4b667a, linux-template-mono|master
Run test -d "/home/runner/work/godot/godot/.scons_cache/" && find "/home/runner/work/godot/godot/.scons_cache/" >> redundant.txt
Error: Process completed with exit code 1.
```

So, if I'm understanding correctly, it's failing to save because there's no cache to restore, and there's no cache to restore because it's failing to save 😅

### Steps to reproduce

- Make a fork
- Push a commit to trigger CI


### Minimal reproduction project (MRP)

N/A

cc @Repiteo 


Discussion / hints:

Fix patch:
diff --git a/.github/actions/godot-cache-restore/action.yml b/.github/actions/godot-cache-restore/action.yml
index 975decb6f816..2cfc62ab076e 100644
--- a/.github/actions/godot-cache-restore/action.yml
+++ b/.github/actions/godot-cache-restore/action.yml
@@ -20,9 +20,9 @@ runs:
         restore-keys: ${{ inputs.cache-name }}|${{ github.event.repository.default_branch }}
 
     - name: Log default cache files
-      if: github.ref_name != github.event.repository.default_branch
+      if: steps.cache-ping.outputs.cache-matched-key && github.ref_name != github.event.repository.default_branch
       shell: sh
-      run: test -d "${{ inputs.scons-cache }}" && find "${{ inputs.scons-cache }}" >> redundant.txt
+      run: find "${{ inputs.scons-cache }}" >> redundant.txt
 
     # This is done after pulling the default cache so that PRs can integrate any potential changes
     # from the default branch without conflicting with whatever local changes were already made.


Test patch: