Try out a task locally.
"try" verifies that all filters match and that files
have been modified in a repository.
Use this command during local development of a task to try it out
and iterate frequently.
It first executes all filters against the given repository and
provides feedback on whether they match or not.
If all filters match, it clones the repository, executes
the script defined by the task
and provides feedback on whether files have changed or not.
Examples:
# Try all tasks in file "task.yaml" against
# repository "codeberg.org/saturn-sync/saturn-example".
saturn try \
--repository codeberg.org/saturn-sync/saturn-example \
task.yaml
# Try task with name "example" in "task.yaml" against
# repository "codeberg.org/saturn-sync/saturn-example".
saturn try \
--repository codeberg.org/saturn-sync/saturn-example \
--task-name example \
task.yaml
# Set inputs "version" and "date".
# The task in file "task.yaml" defines the expected inputs.
saturn try \
--repository codeberg.org/saturn-sync/saturn-example \
--input version=1.2.3 \
--input date=2024-11-10 \
task.yaml
Usage:
saturn try FILE [flags]
Flags:
--action string The action passed to afterScript as the environment variable ACTION.
One of closed, created, merged or pushed. (default "created")
--config string Path to config file.
--data-dir string Path to directory to clone the repository.
-h, --help help for try
--input stringToString Key/value pair in the format <key>=<value>
to use as an input parameter of a task.
Can be supplied multiple times to set multiple inputs. (default [])
--repository string Name of the repository to test against.
--task-name string If set, try only the task that matches the name.
Useful if a task file contains multiple tasks.