@@ -23,26 +23,6 @@ const getLintCacheDir = (): string => {
2323 return path . resolve ( `${ process . env . HOME } /.cache/golangci-lint` )
2424}
2525
26- const getCacheDirs = ( ) : string [ ] => {
27- // Not existing dirs are ok here: it works.
28- const skipPkgCache = core . getInput ( `skip-pkg-cache` , { required : true } ) . trim ( )
29- const skipBuildCache = core . getInput ( `skip-build-cache` , { required : true } ) . trim ( )
30- const dirs = [ getLintCacheDir ( ) ]
31-
32- if ( skipBuildCache . toLowerCase ( ) == "true" ) {
33- core . info ( `Omitting ~/.cache/go-build from cache directories` )
34- } else {
35- dirs . push ( path . resolve ( `${ process . env . HOME } /.cache/go-build` ) )
36- }
37- if ( skipPkgCache . toLowerCase ( ) == "true" ) {
38- core . info ( `Omitting ~/go/pkg from cache directories` )
39- } else {
40- dirs . push ( path . resolve ( `${ process . env . HOME } /go/pkg` ) )
41- }
42-
43- return dirs
44- }
45-
4626const getIntervalKey = ( invalidationIntervalDays : number ) : string => {
4727 const now = new Date ( )
4828 const secondsSinceEpoch = now . getTime ( ) / 1000
@@ -97,7 +77,7 @@ export async function restoreCache(): Promise<void> {
9777 }
9878 core . saveState ( State . CachePrimaryKey , primaryKey )
9979 try {
100- const cacheKey = await cache . restoreCache ( getCacheDirs ( ) , primaryKey , restoreKeys )
80+ const cacheKey = await cache . restoreCache ( [ getLintCacheDir ( ) ] , primaryKey , restoreKeys )
10181 if ( ! cacheKey ) {
10282 core . info ( `Cache not found for input keys: ${ [ primaryKey , ...restoreKeys ] . join ( ", " ) } ` )
10383 return
@@ -127,7 +107,7 @@ export async function saveCache(): Promise<void> {
127107
128108 const startedAt = Date . now ( )
129109
130- const cacheDirs = getCacheDirs ( )
110+ const cacheDirs = [ getLintCacheDir ( ) ]
131111 const primaryKey = core . getState ( State . CachePrimaryKey )
132112 if ( ! primaryKey ) {
133113 utils . logWarning ( `Error retrieving key from state.` )
0 commit comments