diff --git a/action.yml b/action.yml index 5978921ad..9e2d59cee 100644 --- a/action.yml +++ b/action.yml @@ -57,6 +57,10 @@ inputs: arch: description: Architecture to build for. required: false + build: + description: Toggle building the unikernel. + required: false + default: "true" plat: description: Platform to build for. required: false @@ -207,6 +211,7 @@ runs: -e "INPUT_ARCH=${{ inputs.arch }}" \ -e "INPUT_ARGS=${{ inputs.args }}" \ -e "INPUT_AUTHS=${{ inputs.auths }}" \ + -e "INPUT_BUILD=${{ inputs.build }}" \ -e "INPUT_EXECUTE=${{ inputs.execute }}" \ -e "INPUT_ROOTFS=${{ inputs.rootfs }}" \ -e "INPUT_KRAFTFILE=${{ inputs.kraftfile }}" \ diff --git a/tools/github-action/main.go b/tools/github-action/main.go index 55e72f6f3..cf1425e7f 100644 --- a/tools/github-action/main.go +++ b/tools/github-action/main.go @@ -41,6 +41,7 @@ type GithubAction struct { // Build flags Arch string `long:"arch" env:"INPUT_ARCH" usage:"Architecture to build for"` + Build bool `long:"build" env:"INPUT_BUILD" usage:"Toggle building the unikernel"` Plat string `long:"plat" env:"INPUT_PLAT" usage:"Platform to build for"` Target string `long:"target" env:"INPUT_TARGET" usage:"Name of the target to build for"` @@ -260,8 +261,10 @@ func (opts *GithubAction) Run(ctx context.Context, args []string) (err error) { return fmt.Errorf("could not pull project components: %w", err) } - if err := opts.build(ctx); err != nil { - return fmt.Errorf("could not build unikernel: %w", err) + if opts.Build { + if err := opts.build(ctx); err != nil { + return fmt.Errorf("could not build unikernel: %w", err) + } } if opts.Execute {