Skip to content

Expressions and Context

Action inputs can use ${{ }} expressions. Forge resolves them while the run executes.

NamespaceExampleUse 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 }}"

Context values are injected automatically. You do not define them as inputs.

VariableDescription
context.createdByEmail of the user who started the run
context.userEmailUser email from the authenticated session
context.userIdUser ID from the identity provider
context.tenantIdShoehorn tenant ID
context.runIdUnique run ID
context.moldSlugSlug 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: shoehorn

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.