File tree Expand file tree Collapse file tree 5 files changed +63
-4
lines changed Expand file tree Collapse file tree 5 files changed +63
-4
lines changed Original file line number Diff line number Diff line change 4848 # Optional: show only new issues if it's a pull request. The default value is `false`.
4949 # only-new-issues: true
5050
51- # Optional: if set to true then the action will use pre-installed Go
51+ # Optional: if set to true then the action will use pre-installed Go.
5252 # skip-go-installation: true
53+
54+ # Optional: if set to true then the action don't cache or restore ~/go/pkg.
55+ # skip-pkg-cache: true
56+
57+ # Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
58+ # skip-build-cache: true
5359```
5460
5561We recommend running this action in a job separate from other jobs (` go test ` , etc)
Original file line number Diff line number Diff line change @@ -24,6 +24,14 @@ inputs:
2424 description : " if set to true then action uses pre-installed Go"
2525 default : false
2626 required : true
27+ skip-pkg-cache :
28+ description : " if set to true then the action don't cache or restore ~/go/pkg."
29+ default : false
30+ required : true
31+ skip-build-cache :
32+ description : " if set to true then the action don't cache or restore ~/.cache/go-build."
33+ default : false
34+ required : true
2735runs :
2836 using : " node12"
2937 main : " dist/run/index.js"
Original file line number Diff line number Diff line change @@ -49992,7 +49992,22 @@ const getLintCacheDir = () => {
4999249992};
4999349993const getCacheDirs = () => {
4999449994 // Not existing dirs are ok here: it works.
49995- return [getLintCacheDir(), path_1.default.resolve(`${process.env.HOME}/.cache/go-build`), path_1.default.resolve(`${process.env.HOME}/go/pkg`)];
49995+ const skipPkgCache = core.getInput(`skip-pkg-cache`, { required: true }).trim();
49996+ const skipBuildCache = core.getInput(`skip-build-cache`, { required: true }).trim();
49997+ const dirs = [getLintCacheDir()];
49998+ if (skipBuildCache.toLowerCase() == "true") {
49999+ core.info(`Omitting ~/.cache/go-build from cache directories`);
50000+ }
50001+ else {
50002+ dirs.push(path_1.default.resolve(`${process.env.HOME}/.cache/go-build`));
50003+ }
50004+ if (skipPkgCache.toLowerCase() == "true") {
50005+ core.info(`Omitting ~/go/pkg from cache directories`);
50006+ }
50007+ else {
50008+ dirs.push(path_1.default.resolve(`${process.env.HOME}/go/pkg`));
50009+ }
50010+ return dirs;
4999650011};
4999750012const getIntervalKey = (invalidationIntervalDays) => {
4999850013 const now = new Date();
Original file line number Diff line number Diff line change @@ -50002,7 +50002,22 @@ const getLintCacheDir = () => {
5000250002};
5000350003const getCacheDirs = () => {
5000450004 // Not existing dirs are ok here: it works.
50005- return [getLintCacheDir(), path_1.default.resolve(`${process.env.HOME}/.cache/go-build`), path_1.default.resolve(`${process.env.HOME}/go/pkg`)];
50005+ const skipPkgCache = core.getInput(`skip-pkg-cache`, { required: true }).trim();
50006+ const skipBuildCache = core.getInput(`skip-build-cache`, { required: true }).trim();
50007+ const dirs = [getLintCacheDir()];
50008+ if (skipBuildCache.toLowerCase() == "true") {
50009+ core.info(`Omitting ~/.cache/go-build from cache directories`);
50010+ }
50011+ else {
50012+ dirs.push(path_1.default.resolve(`${process.env.HOME}/.cache/go-build`));
50013+ }
50014+ if (skipPkgCache.toLowerCase() == "true") {
50015+ core.info(`Omitting ~/go/pkg from cache directories`);
50016+ }
50017+ else {
50018+ dirs.push(path_1.default.resolve(`${process.env.HOME}/go/pkg`));
50019+ }
50020+ return dirs;
5000650021};
5000750022const getIntervalKey = (invalidationIntervalDays) => {
5000850023 const now = new Date();
Original file line number Diff line number Diff line change @@ -25,7 +25,22 @@ const getLintCacheDir = (): string => {
2525
2626const getCacheDirs = ( ) : string [ ] => {
2727 // Not existing dirs are ok here: it works.
28- return [ getLintCacheDir ( ) , path . resolve ( `${ process . env . HOME } /.cache/go-build` ) , path . resolve ( `${ process . env . HOME } /go/pkg` ) ]
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
2944}
3045
3146const getIntervalKey = ( invalidationIntervalDays : number ) : string => {
You can’t perform that action at this time.
0 commit comments