In addition to automatically starting CI/CD workflows based on specific trigger events, you can start the process manually from the SourceCraft interface.
On the Home tab, under Your craftspace, navigate to Repositories and select your repository.
Under Code on the repository page, go to Branches.
Select the branch for editing.
Open the .sourcecraft/ci.yaml file.
In the top-right corner, click Edit.
Add the inputs block to the workflow parameters. Here is an example:
workflows:test-workflow:inputs:username:type:stringrequired:truedefault:JohnDoedescription:Requiredstringvalue.show-name:type:booldefault:truedescription: Optional Boolean value:trueorfalse.Defaultvalueistrue.language:type:choicedefault:Russianoptions:-Russian-English-Chinesedescription: Optional value:selectone.DefaultvalueisRussian.tasks:-name:sample-taskenv:# Replace with the names of the elements from the inputs block,# such as inputs.username, inputs.show-name, inputs.language.NAME:${{inputs.<name_of_first_element_from_inputs>}}SHOW_NAME:${{inputs.<name_of_second_element_from_inputs>}}LANGUAGE:${{inputs.<name_of_third_element_from_inputs>}}cubes:-name:sample-cubescript:-|
case "$LANGUAGE" in
"Russian")
echo "Hello world!"
if [ "$SHOW_NAME" = "true" ]; then
echo "My name is $NAME."
fi
;;
"English")
echo "Hello, world!"
if [ "$SHOW_NAME" = "true" ]; then
echo "My name is $NAME."
fi
;;
"Chinese")
echo "你好,世界!"
if [ "$SHOW_NAME" = "true" ]; then
echo "我的名字是 $NAME。"
fi
;;
esac
on:push:test-workflow
Where:
type: Parameter type. The possible values are:
string: String.
bool: Logical value, true or false.
choice: Select from the preset values.
Note
If the configuration contains the options parameter, you do not need to set the type: choice parameter.
If the type is not specified and there is no options parameter, the default parameter type is string.
required: Required parameter. The possible values are true or false.
description: Any description of the parameter that will be displayed in the SourceCraft interface when manually running the workflow.
default: Default parameter value. You can also specify it if the parameter is required.
options: Possible values for the choice parameter type.
In the top-right corner, click Commit changes.
In the window that opens, configure the change parameters:
In the Commit message field, specify the comment describing the changes you have made.
Under Commit branch, select the branch you want to edit. If required, create a new branch.
Under After commit action, select how to make changes: via a commit or a pull request.
Confirm your changes.
If you opt to submit a pull request, finish creating one.
Under Code on the repository page, go to CI/CD.
At the top right, click New launch and configure the start:
Select the branch housing the .sourcecraft/ci.yaml file with the workflow you need.
Select a workflow.
Select a branch to start the workflow in.
Fill in the other parameters.
Click Launch now.
Check the workflow run:
Under Code on the repository page, go to CI/CD.
Select a running workflow.
The page that opens will display all workflow tasks, cubes (task steps), as well as statuses and execution results.