diff --git a/.github/workflows/client-sdks.yml b/.github/workflows/client-sdks.yml index 4e8fa24c95..8392741816 100644 --- a/.github/workflows/client-sdks.yml +++ b/.github/workflows/client-sdks.yml @@ -256,5 +256,9 @@ jobs: key: ${{ steps.packages.outputs.cache-primary-key }} concurrency: - group: ci-client-sdks-${{ github.workflow }}-${{ github.head_ref || github.ref_name }} - cancel-in-progress: true + # The event is in the key so a pull request from a fork's `main` never joins main's push group. + group: ci-client-sdks-${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref_name }} + # A running run on main is not cancelled by a newer push, and a newer push replaces only a pending + # one. Only a finished push run saves the Swift package cache (#2235, #2225). A pull request run + # still cancels the one before it. + cancel-in-progress: ${{ github.event_name == 'pull_request' }}