ci, refactor: Reuse primary key in `actions/cache/save`
What changed, and why it matters
This is a minor GitHub Actions workflow cleanup. It changes three cache-save steps to reuse the cache key that was already computed by an earlier cache-restore step, instead of manually building the key again. There is no security-relevant change.
No security action needed. Treat as a normal CI maintainability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors .github/workflows/ci.yml so that actions/cache/save steps use ${{ steps.<id>.outputs.cache-primary-key }} rather than reconstructing the key inline with expressions like ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}. This is a pure refactor: the resulting cache keys are functionally identical, and no permissions, inputs, secrets, or build commands are modified.
Changed components
.github/workflows/ci.ymlInspect captured patch +3 / −3
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f12ceb01..b4904255 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -211,7 +211,7 @@ jobs:
with:
path: ${{ env.CCACHE_DIR }}
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
- key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}
+ key: ${{ steps.ccache-cache.outputs.cache-primary-key }}
windows-native-dll:
name: ${{ matrix.job-name }}
@@ -277,7 +277,7 @@ jobs:
if: github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch && steps.vcpkg-binary-cache.outputs.cache-hit != 'true' && matrix.job-type == 'standard'
with:
path: ~/AppData/Local/vcpkg/archives
- key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }}
+ key: ${{ steps.vcpkg-binary-cache.outputs.cache-primary-key }}
- name: Save vcpkg tools cache
uses: actions/cache/save@v5
@@ -285,7 +285,7 @@ jobs:
if: github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch && steps.vcpkg-tools-cache.outputs.cache-hit != 'true' && matrix.job-type == 'standard'
with:
path: ~/AppData/Local/vcpkg/downloads/tools
- key: ${{ github.job }}-vcpkg-tools-${{ github.run_id }}
+ key: ${{ steps.vcpkg-tools-cache.outputs.cache-primary-key }}
- name: Build
run: |
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.