diff --git a/_examples/actions/write_a_readme/actions/action.go b/_examples/actions/write_a_readme/actions/action.go new file mode 100644 index 0000000..7905807 --- /dev/null +++ b/_examples/actions/write_a_readme/actions/action.go @@ -0,0 +1,5 @@ +package main + +func main() { + +} diff --git a/_examples/actions/write_a_readme/go.mod b/_examples/actions/write_a_readme/go.mod new file mode 100644 index 0000000..066dd7a --- /dev/null +++ b/_examples/actions/write_a_readme/go.mod @@ -0,0 +1,4 @@ +module write_a_readme + +go 1.19 + diff --git a/_examples/actions/write_a_readme/kraken.yml b/_examples/actions/write_a_readme/kraken.yml new file mode 100644 index 0000000..cc49b8a --- /dev/null +++ b/_examples/actions/write_a_readme/kraken.yml @@ -0,0 +1,8 @@ +apiVersion: kraken.front.kjuulh.io/schema/v1 +name: write-a-readme +repositories: + - git@git.front.kjuulh.io:kjuulh/kraken-test.git +predicates: + - predicate.go +actions: + - action.go diff --git a/_examples/actions/write_a_readme/predicates/predicate.go b/_examples/actions/write_a_readme/predicates/predicate.go new file mode 100644 index 0000000..06ab7d0 --- /dev/null +++ b/_examples/actions/write_a_readme/predicates/predicate.go @@ -0,0 +1 @@ +package main diff --git a/pkg/actions/interface.go b/pkg/actions/interface.go new file mode 100644 index 0000000..8fc4590 --- /dev/null +++ b/pkg/actions/interface.go @@ -0,0 +1,6 @@ +package actions + +import "context" + +type Predicate func(ctx context.Context, path string) (bool, error) +type Action func(ctx context.Context, path string) error