From c7252fbcee0cd78c51a26ddf3e5b106e0e002f19 Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Wed, 22 Apr 2026 23:14:03 +0000 Subject: [PATCH 1/3] move the repository cache out of /workspace --- bazel-docker/action.yml | 2 +- internal/repository-cache-restore/action.yml | 4 ++-- internal/repository-cache-save/action.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bazel-docker/action.yml b/bazel-docker/action.yml index 41cc39d..6c49fd3 100644 --- a/bazel-docker/action.yml +++ b/bazel-docker/action.yml @@ -76,7 +76,7 @@ runs: - name: Hook up repository Cache shell: bash - run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --repository_cache='/workspace/${{ env.REPOSITORY_CACHE_PATH }}'" >> $GITHUB_ENV + run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --repository_cache='/${{ env.REPOSITORY_CACHE_PATH }}'" >> $GITHUB_ENV - name: Validate inputs if: ${{ (inputs.bash && inputs.bazel) || (!inputs.bash && !inputs.bazel) }} diff --git a/internal/repository-cache-restore/action.yml b/internal/repository-cache-restore/action.yml index f70f695..1cc13a0 100644 --- a/internal/repository-cache-restore/action.yml +++ b/internal/repository-cache-restore/action.yml @@ -44,10 +44,10 @@ runs: - name: Restore Bazel repository cache id: restore-cache # Skip if there's already a downloaded cache - if: ${{ hashFiles(format('{0}/{1}', github.workspace, env.REPOSITORY_CACHE_PATH)) == '' }} + if: ${{ hashFiles(format('{0}', env.REPOSITORY_CACHE_PATH)) == '' }} uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: - path: ${{ github.workspace }}/${{ env.REPOSITORY_CACHE_PATH }} + path: ${{ env.REPOSITORY_CACHE_PATH }} key: ${{ env.REPOSITORY_CACHE_NAME }} restore-keys: ${{ env.REPOSITORY_CACHE_BASE }} diff --git a/internal/repository-cache-save/action.yml b/internal/repository-cache-save/action.yml index c00ba69..2bc3121 100644 --- a/internal/repository-cache-save/action.yml +++ b/internal/repository-cache-save/action.yml @@ -29,5 +29,5 @@ runs: if: ${{ env.REPOSITORY_CACHE_HASH != hashFiles(format('{0}/**', env.REPOSITORY_CACHE_PATH)) }} uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: - path: ${{ github.workspace }}/${{ env.REPOSITORY_CACHE_PATH }} + path: ${{ env.REPOSITORY_CACHE_PATH }} key: ${{ env.REPOSITORY_CACHE_BASE }}-${{ github.sha }} From 21c2f7e2f2167d30437e2273d31be9b680243d96 Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Thu, 23 Apr 2026 01:29:18 +0000 Subject: [PATCH 2/3] add leading / to ${{ env.REPOSITORY_CACHE_PATH }} --- internal/repository-cache-restore/action.yml | 4 ++-- internal/repository-cache-save/action.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/repository-cache-restore/action.yml b/internal/repository-cache-restore/action.yml index 1cc13a0..aeeef45 100644 --- a/internal/repository-cache-restore/action.yml +++ b/internal/repository-cache-restore/action.yml @@ -44,10 +44,10 @@ runs: - name: Restore Bazel repository cache id: restore-cache # Skip if there's already a downloaded cache - if: ${{ hashFiles(format('{0}', env.REPOSITORY_CACHE_PATH)) == '' }} + if: ${{ hashFiles(format('/{0}', env.REPOSITORY_CACHE_PATH)) == '' }} uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: - path: ${{ env.REPOSITORY_CACHE_PATH }} + path: /${{ env.REPOSITORY_CACHE_PATH }} key: ${{ env.REPOSITORY_CACHE_NAME }} restore-keys: ${{ env.REPOSITORY_CACHE_BASE }} diff --git a/internal/repository-cache-save/action.yml b/internal/repository-cache-save/action.yml index 2bc3121..5dfcc3a 100644 --- a/internal/repository-cache-save/action.yml +++ b/internal/repository-cache-save/action.yml @@ -29,5 +29,5 @@ runs: if: ${{ env.REPOSITORY_CACHE_HASH != hashFiles(format('{0}/**', env.REPOSITORY_CACHE_PATH)) }} uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 with: - path: ${{ env.REPOSITORY_CACHE_PATH }} + path: /${{ env.REPOSITORY_CACHE_PATH }} key: ${{ env.REPOSITORY_CACHE_BASE }}-${{ github.sha }} From fceef05c5cc68666fc7730b030e86c2827ec9474 Mon Sep 17 00:00:00 2001 From: Jie Luo Date: Thu, 23 Apr 2026 01:36:24 +0000 Subject: [PATCH 3/3] update bazel/action.yml --- bazel/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel/action.yml b/bazel/action.yml index 99c5969..55f1a10 100644 --- a/bazel/action.yml +++ b/bazel/action.yml @@ -116,7 +116,7 @@ runs: - name: Hook up repository Cache shell: bash - run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --repository_cache=$(pwd)/${{ env.REPOSITORY_CACHE_PATH }}" >> $GITHUB_ENV + run: echo "BAZEL_FLAGS=$BAZEL_FLAGS --repository_cache=/${{ env.REPOSITORY_CACHE_PATH }}" >> $GITHUB_ENV # TODO(b/467211650) this shouldn't be necessary, remove it - name: Append additional flags