MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / WorkflowCreate

Method WorkflowCreate

extras/dagger/main.go:836–870  ·  view source on GitHub ↗

standalone API calls Create a new workflow

(
	ctx context.Context,
	// Chainloop API token
	token *dagger.Secret,
	// Workflow name
	name string,
	// Workflow project
	project string,
	// +optional
	team string,
	// +optional
	description string,
	// name of an existing contract
	// +optional
	contractName string,
	// Set workflow as public so other organizations can see it
	// +optional
	public bool,
	// If the workflow already exists, skip the creation and return success
	// +optional
	skipIfExists bool,
)

Source from the content-addressed store, hash-verified

834
835// Create a new workflow
836func (m *Chainloop) WorkflowCreate(
837 ctx context.Context,
838 // Chainloop API token
839 token *dagger.Secret,
840 // Workflow name
841 name string,
842 // Workflow project
843 project string,
844 // +optional
845 team string,
846 // +optional
847 description string,
848 // name of an existing contract
849 // +optional
850 contractName string,
851 // Set workflow as public so other organizations can see it
852 // +optional
853 public bool,
854 // If the workflow already exists, skip the creation and return success
855 // +optional
856 skipIfExists bool,
857) (string, error) {
858 return cliContainer(0, token, m.Instance, nil, nil, m.Enterprise).
859 WithExec([]string{
860 "workflow", "create",
861 "--name", name,
862 "--project", project,
863 "--team", team,
864 "--description", description,
865 "--contract", contractName,
866 "--public", fmt.Sprintf("%t", public),
867 "--skip-if-exists", fmt.Sprintf("%t", skipIfExists),
868 }, execOpts).
869 Stdout(ctx)
870}

Callers

nothing calls this directly

Calls 1

cliContainerFunction · 0.85

Tested by

no test coverage detected