Fix bazel version not working with disk cache (#119)

This commit is contained in:
Xavier Bonaventura 2026-01-10 21:27:24 +01:00 committed by GitHub
parent dbfe7273a9
commit b26a6f0e11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,7 +52,10 @@ const diskCacheConfig = core.getInput('disk-cache')
const diskCacheEnabled = diskCacheConfig !== 'false'
let diskCacheName = 'disk'
if (diskCacheEnabled) {
bazelrc.push(`common --disk_cache=${bazelDisk}`)
// Before Bazel 6.3, providing --disk_cache to common is an error,
// with Bazel 6.3 and onwards, common accepts any legal Bazel option
// https://github.com/bazelbuild/bazel/issues/3054
bazelrc.push(`build --disk_cache=${bazelDisk}`)
if (diskCacheName !== 'true') {
diskCacheName = `${diskCacheName}-${diskCacheConfig}`
}