File tree 3 files changed +21
-7
lines changed
3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -67482,9 +67482,14 @@ function buildCacheKeys() {
67482
67482
// TODO: configure it via inputs.
67483
67483
let cacheKey = `golangci-lint.cache-${getIntervalKey(7)}-`;
67484
67484
keys.push(cacheKey);
67485
- if (yield pathExists(`go.mod`)) {
67485
+ // Get working directory from input
67486
+ const workingDirectory = core.getInput(`working-directory`);
67487
+ // create path to go.mod prepending the workingDirectory if it exists
67488
+ const goModPath = path_1.default.join(workingDirectory, `go.mod`);
67489
+ core.info(`Checking for go.mod: ${goModPath}`);
67490
+ if (yield pathExists(goModPath)) {
67486
67491
// Add checksum to key to invalidate a cache when dependencies change.
67487
- cacheKey += yield checksumFile(`sha1`, `go.mod` );
67492
+ cacheKey += yield checksumFile(`sha1`, goModPath );
67488
67493
}
67489
67494
else {
67490
67495
cacheKey += `nogomod`;
Original file line number Diff line number Diff line change @@ -67482,9 +67482,14 @@ function buildCacheKeys() {
67482
67482
// TODO: configure it via inputs.
67483
67483
let cacheKey = `golangci-lint.cache-${getIntervalKey(7)}-`;
67484
67484
keys.push(cacheKey);
67485
- if (yield pathExists(`go.mod`)) {
67485
+ // Get working directory from input
67486
+ const workingDirectory = core.getInput(`working-directory`);
67487
+ // create path to go.mod prepending the workingDirectory if it exists
67488
+ const goModPath = path_1.default.join(workingDirectory, `go.mod`);
67489
+ core.info(`Checking for go.mod: ${goModPath}`);
67490
+ if (yield pathExists(goModPath)) {
67486
67491
// Add checksum to key to invalidate a cache when dependencies change.
67487
- cacheKey += yield checksumFile(`sha1`, `go.mod` );
67492
+ cacheKey += yield checksumFile(`sha1`, goModPath );
67488
67493
}
67489
67494
else {
67490
67495
cacheKey += `nogomod`;
Original file line number Diff line number Diff line change @@ -56,10 +56,14 @@ async function buildCacheKeys(): Promise<string[]> {
56
56
// TODO: configure it via inputs.
57
57
let cacheKey = `golangci-lint.cache-${ getIntervalKey ( 7 ) } -`
58
58
keys . push ( cacheKey )
59
-
60
- if ( await pathExists ( `go.mod` ) ) {
59
+ // Get working directory from input
60
+ const workingDirectory = core . getInput ( `working-directory` )
61
+ // create path to go.mod prepending the workingDirectory if it exists
62
+ const goModPath = path . join ( workingDirectory , `go.mod` )
63
+ core . info ( `Checking for go.mod: ${ goModPath } ` )
64
+ if ( await pathExists ( goModPath ) ) {
61
65
// Add checksum to key to invalidate a cache when dependencies change.
62
- cacheKey += await checksumFile ( `sha1` , `go.mod` )
66
+ cacheKey += await checksumFile ( `sha1` , goModPath )
63
67
} else {
64
68
cacheKey += `nogomod`
65
69
}
You can’t perform that action at this time.
0 commit comments