Core Concept
Variables
Shiro supports template-based variable resolution using double curly braces syntax: {{variable}}
Variable Types
| Syntax | Source |
|---|---|
| {{inputs.name}} | Workflow inputs |
| {{env.VAR_NAME}} | Environment variables |
| {{steps.step_id.output}} | Step output |
| {{data.key}} | Data store values |
Examples
Workflow Inputs
json
{
"inputs": {
"environment": "staging",
"version": "1.0.0"
},
"steps": [
{
"id": "deploy",
"type": "shell",
"config": {
"command": "deploy --env {{inputs.environment}} --version {{inputs.version}}"
}
}
]
}Environment Variables
json
{
"id": "slack_notify",
"type": "slack.notify",
"config": {
"webhook_url": "{{env.SLACK_WEBHOOK_URL}}",
"channel": "{{env.SLACK_CHANNEL}}",
"message": "Build {{env.CI_COMMIT_SHA}} completed"
}
}Step Outputs
json
{
"steps": [
{
"id": "get_version",
"type": "shell",
"config": {
"command": "cat package.json | jq -r .version"
}
},
{
"id": "tag_release",
"type": "shell",
"config": {
"command": "git tag v{{steps.get_version.stdout}}"
},
"depends_on": ["get_version"]
}
]
}Common CI Variables
Automatically available in CI environments:
{{env.CI_PROJECT_ID}}- GitLab project ID{{env.CI_COMMIT_SHA}}- Commit SHA{{env.CI_COMMIT_REF_NAME}}- Branch name{{env.CI_MERGE_REQUEST_IID}}- MR number