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 @@ -67348,9 +67348,14 @@ function buildCacheKeys() {
67348
67348
// TODO: configure it via inputs.
67349
67349
let cacheKey = `golangci-lint.cache-${getIntervalKey(7)}-`;
67350
67350
keys.push(cacheKey);
67351
- if (yield pathExists(`go.mod`)) {
67351
+ // Get working directory from input
67352
+ const workingDirectory = core.getInput(`working-directory`);
67353
+ // create path to go.mod prepending the workingDirectory if it exists
67354
+ const goModPath = path_1.default.join(workingDirectory, `go.mod`);
67355
+ core.info(`Checking for go.mod: ${goModPath}`);
67356
+ if (yield pathExists(goModPath)) {
67352
67357
// Add checksum to key to invalidate a cache when dependencies change.
67353
- cacheKey += yield checksumFile(`sha1`, `go.mod` );
67358
+ cacheKey += yield checksumFile(`sha1`, goModPath );
67354
67359
}
67355
67360
else {
67356
67361
cacheKey += `nogomod`;
Original file line number Diff line number Diff line change @@ -67348,9 +67348,14 @@ function buildCacheKeys() {
67348
67348
// TODO: configure it via inputs.
67349
67349
let cacheKey = `golangci-lint.cache-${getIntervalKey(7)}-`;
67350
67350
keys.push(cacheKey);
67351
- if (yield pathExists(`go.mod`)) {
67351
+ // Get working directory from input
67352
+ const workingDirectory = core.getInput(`working-directory`);
67353
+ // create path to go.mod prepending the workingDirectory if it exists
67354
+ const goModPath = path_1.default.join(workingDirectory, `go.mod`);
67355
+ core.info(`Checking for go.mod: ${goModPath}`);
67356
+ if (yield pathExists(goModPath)) {
67352
67357
// Add checksum to key to invalidate a cache when dependencies change.
67353
- cacheKey += yield checksumFile(`sha1`, `go.mod` );
67358
+ cacheKey += yield checksumFile(`sha1`, goModPath );
67354
67359
}
67355
67360
else {
67356
67361
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