In a composite action, how do you reference an input named 'deploy-env' inside a run step?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Composite action inputs are accessed through the 'inputs' context — the same pattern as workflow_call and workflow_dispatch inputs.
Full explanation below image
Full Explanation
In composite actions (and in workflow_call and workflow_dispatch contexts), inputs are accessed using '${{ inputs.input-name }}'. This applies in all YAML expressions within the action: step names, run commands, with: parameters. In a 'run:' step within a composite action, you'd use '${{ inputs.deploy-env }}' in the YAML layer, which resolves before the shell runs. To use it as a shell variable safely (to avoid injection), set it as an environment variable: 'env: DEPLOY_ENV: ${{ inputs.deploy-env }}' and reference as '$DEPLOY_ENV' in the shell command. '${{ with.deploy-env }}' and '${{ github.inputs.deploy-env }}' are not valid expressions.