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