From 44eea01abcf22eea15d9a1c38f447e35ef180023 Mon Sep 17 00:00:00 2001 From: Mike Kruskal <62662355+mkruskal-google@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:38:48 -0700 Subject: [PATCH] Use a hash of the image url in the bazel cache key (#40) * Use a hash of the image url in the bazel cache key * Add missing shell argument --- bazel-docker/action.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bazel-docker/action.yml b/bazel-docker/action.yml index adbe94f..7312f51 100644 --- a/bazel-docker/action.yml +++ b/bazel-docker/action.yml @@ -62,12 +62,17 @@ runs: - name: Setup Runner uses: ./../../_actions/current/internal/setup-runner + - name: Calculate Image Hash + id: image-hash + shell: bash + run: echo ::set-output name=value::$(echo ${{ inputs.image }} | md5sum | cut -f1 -d" ") + - name: Setup Bazel id: bazel uses: ./../../_actions/current/internal/bazel-setup with: credentials-file: /workspace/$(basename ${{ steps.auth.outputs.credentials-file }}) - bazel-cache: ${{ inputs.bazel-cache }} + bazel-cache: ${{ inputs.bazel-cache }}-${{ steps.image-hash.outputs.value }} - name: Hook up repository Cache shell: bash