summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorMarius Zwicker <marius@mlba-team.de>2023-06-15 03:16:00 +0200
committerGitHub <noreply@github.com>2023-06-15 03:16:00 +0200
commit74c27db4dd685b1465832c4de73786e397e2a3ce (patch)
treec5143bda9d7e752d8bc12829cfae7e64d1f487fd /cmd
parentDrop disappeared `wei/curl@v1` (#1864) (diff)
downloadforgejo-act-74c27db4dd685b1465832c4de73786e397e2a3ce.tar.xz
forgejo-act-74c27db4dd685b1465832c4de73786e397e2a3ce.zip
Allow to override location of action cache dir (#1863)
Adds an option to specify the directory below which actions and host workspaces will be stored. If left empty the previous location at $XDG_CACHE_HOME/act or $HOME/.cache/act will be used respectively. Co-authored-by: Casey Lee <cplee@nektos.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/input.go1
-rw-r--r--cmd/root.go2
2 files changed, 3 insertions, 0 deletions
diff --git a/cmd/input.go b/cmd/input.go
index 954018f..64556e1 100644
--- a/cmd/input.go
+++ b/cmd/input.go
@@ -54,6 +54,7 @@ type Input struct {
replaceGheActionWithGithubCom []string
replaceGheActionTokenWithGithubCom string
matrix []string
+ actionCachePath string
}
func (i *Input) resolve(path string) string {
diff --git a/cmd/root.go b/cmd/root.go
index ba1f31d..59a571e 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -94,6 +94,7 @@ func Execute(ctx context.Context, version string) {
rootCmd.PersistentFlags().StringVarP(&input.cacheServerPath, "cache-server-path", "", filepath.Join(CacheHomeDir, "actcache"), "Defines the path where the cache server stores caches.")
rootCmd.PersistentFlags().StringVarP(&input.cacheServerAddr, "cache-server-addr", "", common.GetOutboundIP().String(), "Defines the address to which the cache server binds.")
rootCmd.PersistentFlags().Uint16VarP(&input.cacheServerPort, "cache-server-port", "", 0, "Defines the port where the artifact server listens. 0 means a randomly available port.")
+ rootCmd.PersistentFlags().StringVarP(&input.actionCachePath, "action-cache-path", "", filepath.Join(CacheHomeDir, "act"), "Defines the path where the actions get cached and host workspaces created.")
rootCmd.SetArgs(args())
if err := rootCmd.Execute(); err != nil {
@@ -580,6 +581,7 @@ func newRunCommand(ctx context.Context, input *Input) func(*cobra.Command, []str
ForceRebuild: input.forceRebuild,
ReuseContainers: input.reuseContainers,
Workdir: input.Workdir(),
+ ActionCacheDir: input.actionCachePath,
BindWorkdir: input.bindWorkdir,
LogOutput: !input.noOutput,
JSONLogger: input.jsonLogger,