name: Save cache inputs: key: required: true description: Primary key to the cache, should be retrieved from `cache-restore` composite action outputs. additional-paths: required: false runs: using: "composite" steps: # Fork PRs on pull_request already can't write to the base repo's cache (GitHub built-in). # The fork guard is defense-in-depth for pull_request_target, which does have write access. - name: Save cache if: ${{ format('{0}', github.event.pull_request.head.repo.fork) != 'true' }} uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 (save) with: key: ${{ inputs.key }} path: | .cache .nx node_modules/.cache packages/*/node_modules/.cache ${{ inputs.additional-paths }}