From 592dc4bf2c610273519c40ebf6f828079f637651 Mon Sep 17 00:00:00 2001 From: ChristopherHX Date: Wed, 29 Jan 2025 17:25:39 +0100 Subject: [PATCH] [BREAKING] new pull-if-needed no-rebuild (#32) * Old inverted names removed --- cmd/input.go | 4 ++-- cmd/root.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/input.go b/cmd/input.go index c7e09ffb..521d9be4 100644 --- a/cmd/input.go +++ b/cmd/input.go @@ -21,8 +21,8 @@ type Input struct { inputs []string platforms []string dryrun bool - forcePull bool - forceRebuild bool + pullIfNeeded bool + noRebuild bool noOutput bool envfile string inputfile string diff --git a/cmd/root.go b/cmd/root.go index 7ca71511..34e3215e 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -69,8 +69,8 @@ func Execute(ctx context.Context, version string) { rootCmd.Flags().StringArrayVarP(&input.platforms, "platform", "P", []string{}, "custom image to use per platform (e.g. -P ubuntu-18.04=nektos/act-environments-ubuntu:18.04)") rootCmd.Flags().BoolVarP(&input.reuseContainers, "reuse", "r", false, "don't remove container(s) on successfully completed workflow(s) to maintain state between runs") rootCmd.Flags().BoolVarP(&input.bindWorkdir, "bind", "b", false, "bind working directory to container, rather than copy") - rootCmd.Flags().BoolVarP(&input.forcePull, "pull", "p", true, "pull docker image(s) even if already present") - rootCmd.Flags().BoolVarP(&input.forceRebuild, "rebuild", "", true, "rebuild local action docker image(s) even if already present") + rootCmd.Flags().BoolVarP(&input.pullIfNeeded, "pull-if-needed", "", false, "only pull docker image(s) if not present") + rootCmd.Flags().BoolVarP(&input.noRebuild, "no-rebuild", "", false, "don't rebuild local action docker action image(s) if already present for correct platform") rootCmd.Flags().BoolVarP(&input.autodetectEvent, "detect-event", "", false, "Use first event type from workflow as event that triggered the workflow") rootCmd.Flags().StringVarP(&input.eventPath, "eventpath", "e", "", "path to event JSON file") rootCmd.Flags().StringVar(&input.defaultBranch, "defaultbranch", "", "the name of the main branch") @@ -584,8 +584,8 @@ func newRunCommand(ctx context.Context, input *Input) func(*cobra.Command, []str EventName: eventName, EventPath: input.EventPath(), DefaultBranch: defaultbranch, - ForcePull: !input.actionOfflineMode && input.forcePull, - ForceRebuild: input.forceRebuild, + ForcePull: !input.actionOfflineMode && !input.pullIfNeeded, + ForceRebuild: !input.noRebuild, ReuseContainers: input.reuseContainers, Workdir: input.Workdir(), ActionCacheDir: input.actionCachePath,