What changed, and why it matters
This commit adds two new GitHub Actions helper files that manage caching for the project's continuous integration (CI) build system. It saves and reuses compiled code and dependency downloads to make automated builds faster. There is no indication this change introduces a security vulnerability or modifies any Bitcoin Core software code that users run.
No security action required. This is a routine CI infrastructure change. Reviewers may optionally verify that the cirruslabs/cache action is a trusted, pinned dependency and that cache paths do not include sensitive build artifacts, but the diff itself does not raise security concerns.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit introduces two composite GitHub Actions, restore-caches and save-caches, which wrap the cirruslabs/cache action for ccache, depends sources, built depends, and previous releases caches. Save operations are gated to push events on the default branch, and restore uses prefix fallback keys. The implementation relies on environment variables (CCACHE_DIR, SOURCES_PATH, BASE_CACHE, PREVIOUS_RELEASES_DIR, CONTAINER_NAME, DEPENDS_HASH, PREVIOUS_RELEASES_HASH) set elsewhere in the CI workflow. No executable project code, cryptographic logic, network protocol handling, or privilege boundaries are changed.
Changed components
.github/actions/restore-caches/action.yml.github/actions/save-caches/action.ymlInspect captured patch +86 / −0
diff --git a/.github/actions/restore-caches/action.yml b/.github/actions/restore-caches/action.yml
new file mode 100644
index 00000000..8dc35d49
--- /dev/null
+++ b/.github/actions/restore-caches/action.yml
@@ -0,0 +1,47 @@
+name: 'Restore Caches'
+description: 'Restore ccache, depends sources, and built depends caches'
+runs:
+ using: 'composite'
+ steps:
+ - name: Restore Ccache cache
+ id: ccache-cache
+ uses: cirruslabs/cache/restore@v4
+ with:
+ path: ${{ env.CCACHE_DIR }}
+ key: ccache-${{ env.CONTAINER_NAME }}-${{ github.run_id }}
+ restore-keys: |
+ ccache-${{ env.CONTAINER_NAME }}-
+
+ - name: Restore depends sources cache
+ id: depends-sources
+ uses: cirruslabs/cache/restore@v4
+ with:
+ path: ${{ env.SOURCES_PATH }}
+ key: depends-sources-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
+ restore-keys: |
+ depends-sources-${{ env.CONTAINER_NAME }}-
+
+ - name: Restore built depends cache
+ id: depends-built
+ uses: cirruslabs/cache/restore@v4
+ with:
+ path: ${{ env.BASE_CACHE }}
+ key: depends-built-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
+ restore-keys: |
+ depends-built-${{ env.CONTAINER_NAME }}-
+
+ - name: Restore previous releases cache
+ id: previous-releases
+ uses: cirruslabs/cache/restore@v4
+ with:
+ path: ${{ env.PREVIOUS_RELEASES_DIR }}
+ key: previous-releases-${{ env.CONTAINER_NAME }}-${{ env.PREVIOUS_RELEASES_HASH }}
+ restore-keys: |
+ previous-releases-${{ env.CONTAINER_NAME }}-
+
+ - name: export cache hits
+ shell: bash
+ run: |
+ echo "depends-sources-cache-hit=${{ steps.depends-sources.outputs.cache-hit }}" >> $GITHUB_ENV
+ echo "depends-built-cache-hit=${{ steps.depends-built.outputs.cache-hit }}" >> $GITHUB_ENV
+ echo "previous-releases-cache-hit=${{ steps.previous-releases.outputs.cache-hit }}" >> $GITHUB_ENV
diff --git a/.github/actions/save-caches/action.yml b/.github/actions/save-caches/action.yml
new file mode 100644
index 00000000..0e3b3124
--- /dev/null
+++ b/.github/actions/save-caches/action.yml
@@ -0,0 +1,39 @@
+name: 'Save Caches'
+description: 'Save ccache, depends sources, and built depends caches'
+runs:
+ using: 'composite'
+ steps:
+ - name: debug cache hit inputs
+ shell: bash
+ run: |
+ echo "depends sources direct cache hit to primary key: ${{ env.depends-sources-cache-hit }}"
+ echo "depends built direct cache hit to primary key: ${{ env.depends-built-cache-hit }}"
+ echo "previous releases direct cache hit to primary key: ${{ env.previous-releases-cache-hit }}"
+
+ - name: Save Ccache cache
+ uses: cirruslabs/cache/save@v4
+ if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) }}
+ with:
+ path: ${{ env.CCACHE_DIR }}
+ key: ccache-${{ env.CONTAINER_NAME }}-${{ github.run_id }}
+
+ - name: Save depends sources cache
+ uses: cirruslabs/cache/save@v4
+ if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.depends-sources-cache-hit != 'true') }}
+ with:
+ path: ${{ env.SOURCES_PATH }}
+ key: depends-sources-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
+
+ - name: Save built depends cache
+ uses: cirruslabs/cache/save@v4
+ if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.depends-built-cache-hit != 'true' )}}
+ with:
+ path: ${{ env.BASE_CACHE }}
+ key: depends-built-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
+
+ - name: Save previous releases cache
+ uses: cirruslabs/cache/save@v4
+ if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.previous-releases-cache-hit != 'true' )}}
+ with:
+ path: ${{ env.PREVIOUS_RELEASES_DIR }}
+ key: previous-releases-${{ env.CONTAINER_NAME }}-${{ env.PREVIOUS_RELEASES_HASH }}
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.