From 50afa38cc810399e5b6d45cd5fe33bba3ec1d2aa Mon Sep 17 00:00:00 2001 From: poofeth <91919121+poofeth@users.noreply.github.com> Date: Wed, 3 Jun 2026 17:48:30 -0500 Subject: [PATCH] Use restore-only ccache on pull_request_target --- ccache/action.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ccache/action.yml b/ccache/action.yml index acaeae3..25ec286 100644 --- a/ccache/action.yml +++ b/ccache/action.yml @@ -79,6 +79,7 @@ runs: ccache --version || echo "No local ccache installation found" - name: Setup fixed path ccache caching + if: ${{ github.event_name != 'pull_request_target' }} uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: path: | @@ -96,6 +97,20 @@ runs: ${{ format('ccache-{0}-{1}', inputs.cache-prefix, github.ref_name) }} ${{ format('ccache-{0}-{1}', inputs.cache-prefix, github.base_ref) }} + - name: Restore fixed path ccache + if: ${{ github.event_name == 'pull_request_target' }} + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 + with: + path: | + .ccache/** + !.ccache/lock + !.ccache/tmp + key: ${{ format('ccache-{0}-{1}-{2}', inputs.cache-prefix, github.ref_name, github.sha) }} + restore-keys: | + ${{ format('ccache-{0}-{1}-{2}', inputs.cache-prefix, github.ref_name, github.sha) }} + ${{ format('ccache-{0}-{1}', inputs.cache-prefix, github.ref_name) }} + ${{ format('ccache-{0}-{1}', inputs.cache-prefix, github.base_ref) }} + - name: Enable module support if: ${{ inputs.support-modules }} shell: bash