diff --git a/bazel-build-test/action.yml b/bazel-build-test/action.yml index b102a04..9223d56 100644 --- a/bazel-build-test/action.yml +++ b/bazel-build-test/action.yml @@ -19,6 +19,10 @@ inputs: description: Path of Bazel workspace required: true default: . + cache-version: + description: Version of the GitHub Actions cache key. + required: false + default: 0 build-options: # TODO(actions/toolkit#184): Use list type rather than newline-delimited # string once it's available. diff --git a/bazel-build-test/index.js b/bazel-build-test/index.js index 2df0f51..b50275d 100644 --- a/bazel-build-test/index.js +++ b/bazel-build-test/index.js @@ -32,7 +32,8 @@ async function run() { const treeHash = await execBash(['git rev-parse HEAD:']); const outputBase = await execBash(['bazelisk info output_base']) - const cacheKey = `bazel-${execRootHash}-${treeHash}`; + const cacheVersion = core.getInput('cache-version'); + const cacheKey = `bazel-${cacheVersion}-${execRootHash}-${treeHash}`; const cachePaths = [outputBase]; if (getInputBool('restore-cache')) { const restoreKeys = [`bazel-${execRootHash}-`];