@@ -31,7 +31,7 @@ type ActionCacheBase struct {
3131}
3232
3333// GetTarArchive implements runner.ActionCache.
34- func (cache * ActionCacheBase ) GetTarArchive (ctx context.Context , cacheDir string , sha string , includePrefix string ) (io.ReadCloser , error ) {
34+ func (cache * ActionCacheBase ) GetTarArchive (ctx context.Context , cacheDir , sha , includePrefix string ) (io.ReadCloser , error ) {
3535 pr , pw := io .Pipe ()
3636 cleanIncludePrefix := path .Clean (includePrefix )
3737 go func () {
@@ -77,7 +77,7 @@ func (cache *ActionCacheBase) GetTarArchive(ctx context.Context, cacheDir string
7777 _ = pw .CloseWithError (err )
7878 return
7979 }
80- _ , err = io .Copy (writer , treader )
80+ _ , err = io .Copy (writer , treader ) //nolint:gosec
8181 if err != nil {
8282 _ = pw .CloseWithError (err )
8383 return
@@ -87,15 +87,16 @@ func (cache *ActionCacheBase) GetTarArchive(ctx context.Context, cacheDir string
8787 return pr , nil
8888}
8989
90- func fetchAction (ctx context.Context , target string , owner string , name string , resolvedSha string , tarURL string , token string , httpClient * http.Client ) (targetFile string , reterr error ) {
90+ func fetchAction (ctx context.Context , target , owner , name , resolvedSha , tarURL , token string , httpClient * http.Client ,
91+ ) (targetFile string , reterr error ) {
9192 logger := common .Logger (ctx )
9293 cachedTar := filepath .Join (target , owner + "." + name + "." + resolvedSha + ".tar" )
9394 defer func () {
9495 if reterr != nil {
9596 _ = os .Remove (cachedTar )
9697 }
9798 }()
98- if fr , err := os .Open (cachedTar ); err == nil {
99+ if fr , err := os .Open (cachedTar ); err == nil { //nolint:gosec
99100 defer func () { _ = fr .Close () }()
100101 if logger != nil {
101102 logger .Infof ("Found cache for action %v/%v (sha:%v) from %v" , owner , name , resolvedSha , cachedTar )
@@ -124,7 +125,7 @@ func fetchAction(ctx context.Context, target string, owner string, name string,
124125 _ , _ = io .Copy (buf , rsp .Body )
125126 return "" , fmt .Errorf ("failed to download action from %v response %v" , tarURL , buf .String ())
126127 }
127- fo , err := os .Create (cachedTar )
128+ fo , err := os .Create (cachedTar ) //nolint:gosec
128129 if err != nil {
129130 return "" , err
130131 }
0 commit comments