@@ -7,6 +7,7 @@ const github = require('@actions/github')
7
7
const bazeliskVersion = core . getInput ( 'bazelisk-version' )
8
8
const cacheVersion = core . getInput ( 'cache-version' )
9
9
const externalCacheConfig = yaml . parse ( core . getInput ( 'external-cache' ) )
10
+ const moduleRoot = core . getInput ( 'module-root' )
10
11
11
12
const homeDir = os . homedir ( )
12
13
const arch = os . arch ( )
@@ -56,10 +57,10 @@ if (diskCacheEnabled) {
56
57
const repositoryCacheConfig = core . getInput ( 'repository-cache' )
57
58
const repositoryCacheEnabled = repositoryCacheConfig !== 'false'
58
59
let repositoryCacheFiles = [
59
- ' MODULE.bazel' ,
60
- ' WORKSPACE.bazel' ,
61
- ' WORKSPACE.bzlmod' ,
62
- ' WORKSPACE'
60
+ ` ${ moduleRoot } / MODULE.bazel` ,
61
+ ` ${ moduleRoot } / WORKSPACE.bazel` ,
62
+ ` ${ moduleRoot } / WORKSPACE.bzlmod` ,
63
+ ` ${ moduleRoot } / WORKSPACE`
63
64
]
64
65
if ( repositoryCacheEnabled ) {
65
66
bazelrc . push ( `common --repository_cache=${ bazelRepository } ` )
@@ -90,21 +91,21 @@ if (externalCacheConfig) {
90
91
externalCache . baseCacheKey = `${ baseCacheKey } -external-`
91
92
externalCache . manifest = {
92
93
files : [
93
- ' MODULE.bazel' ,
94
- ' WORKSPACE.bazel' ,
95
- ' WORKSPACE.bzlmod' ,
96
- ' WORKSPACE'
94
+ ` ${ moduleRoot } / MODULE.bazel` ,
95
+ ` ${ moduleRoot } / WORKSPACE.bazel` ,
96
+ ` ${ moduleRoot } / WORKSPACE.bzlmod` ,
97
+ ` ${ moduleRoot } / WORKSPACE`
97
98
] ,
98
99
name : `external-${ manifestName } -manifest` ,
99
100
path : `${ os . tmpdir ( ) } /external-cache-manifest.txt`
100
101
}
101
102
externalCache . default = {
102
103
enabled : true ,
103
104
files : [
104
- ' MODULE.bazel' ,
105
- ' WORKSPACE.bazel' ,
106
- ' WORKSPACE.bzlmod' ,
107
- ' WORKSPACE'
105
+ ` ${ moduleRoot } / MODULE.bazel` ,
106
+ ` ${ moduleRoot } / WORKSPACE.bazel` ,
107
+ ` ${ moduleRoot } / WORKSPACE.bzlmod` ,
108
+ ` ${ moduleRoot } / WORKSPACE`
108
109
] ,
109
110
name : ( name ) => { return `external-${ name } ` } ,
110
111
paths : ( name ) => {
@@ -130,7 +131,7 @@ module.exports = {
130
131
baseCacheKey,
131
132
bazeliskCache : {
132
133
enabled : core . getBooleanInput ( 'bazelisk-cache' ) ,
133
- files : [ ' .bazelversion' ] ,
134
+ files : [ ` ${ moduleRoot } / .bazelversion` ] ,
134
135
name : 'bazelisk' ,
135
136
paths : [ core . toPosixPath ( `${ userCacheDir } /bazelisk` ) ]
136
137
} ,
@@ -140,8 +141,8 @@ module.exports = {
140
141
enabled : diskCacheEnabled ,
141
142
files : [
142
143
...repositoryCacheFiles ,
143
- ' **/BUILD.bazel' ,
144
- ' **/BUILD'
144
+ ` ${ moduleRoot } / **/BUILD.bazel` ,
145
+ ` ${ moduleRoot } / **/BUILD`
145
146
] ,
146
147
name : diskCacheName ,
147
148
paths : [ bazelDisk ]
0 commit comments