@@ -23,26 +23,6 @@ const getLintCacheDir = (): string => {
23
23
return path . resolve ( `${ process . env . HOME } /.cache/golangci-lint` )
24
24
}
25
25
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
-
46
26
const getIntervalKey = ( invalidationIntervalDays : number ) : string => {
47
27
const now = new Date ( )
48
28
const secondsSinceEpoch = now . getTime ( ) / 1000
@@ -97,7 +77,7 @@ export async function restoreCache(): Promise<void> {
97
77
}
98
78
core . saveState ( State . CachePrimaryKey , primaryKey )
99
79
try {
100
- const cacheKey = await cache . restoreCache ( getCacheDirs ( ) , primaryKey , restoreKeys )
80
+ const cacheKey = await cache . restoreCache ( [ getLintCacheDir ( ) ] , primaryKey , restoreKeys )
101
81
if ( ! cacheKey ) {
102
82
core . info ( `Cache not found for input keys: ${ [ primaryKey , ...restoreKeys ] . join ( ", " ) } ` )
103
83
return
@@ -127,7 +107,7 @@ export async function saveCache(): Promise<void> {
127
107
128
108
const startedAt = Date . now ( )
129
109
130
- const cacheDirs = getCacheDirs ( )
110
+ const cacheDirs = [ getLintCacheDir ( ) ]
131
111
const primaryKey = core . getState ( State . CachePrimaryKey )
132
112
if ( ! primaryKey ) {
133
113
utils . logWarning ( `Error retrieving key from state.` )
0 commit comments