Expressions and Context
Action inputs can use ${{ }} expressions. Forge resolves them while the run executes.
| Namespace | Example | Use it for |
|---|---|---|
inputs |
${{ inputs.name }} |
Values entered in the run form |
parameters |
${{ parameters.name }} |
Alias for inputs |
steps |
${{ steps.create-repo.output.html_url }} |
Outputs from earlier steps |
context |
${{ context.createdBy }} |
Run and user metadata |
secrets |
${{ secrets.GITHUB_TOKEN }} |
Secret values when the run mode allows them |
env |
${{ env.NODE_ENV }} |
Environment variables when the run mode allows them |
If the whole YAML value is one expression, Forge preserves the original type:
private: "${{ inputs.private }}"If the expression is mixed with other text, Forge returns a string:
message: "Create ${{ inputs.name }}"Run context
Section titled “Run context”Context values are injected automatically. You do not define them as inputs.
| Variable | Description |
|---|---|
context.createdBy |
Email of the user who started the run |
context.userEmail |
User email from the authenticated session |
context.userId |
User ID from the identity provider |
context.tenantId |
Shoehorn tenant ID |
context.runId |
Unique run ID |
context.moldSlug |
Slug of the mold being executed |
Example:
steps: - id: create-repo name: Create repository action: github.repo.create inputs: name: "${{ inputs.name }}" owner: "${{ inputs.owner }}" custom_properties: created-by: "${{ context.createdBy }}" managed-by: shoehornConditional steps
Section titled “Conditional steps”Use if: when a step should only run for some inputs.
steps: - id: register-entity name: Register in catalog action: catalog.entity.register if: "${{ inputs.registerCatalog }}" inputs: service_id: "${{ inputs.name }}" name: "${{ inputs.name }}" type: service owner: "${{ inputs.team }}"A boolean false skips the step. Empty values are skipped too.