Azure Pipelines "Bash@3" Requires targetType (inline vs filePath)
The Bash@3 task needs a targetType (inline or filePath) and the matching input - script for inline, filePath for a file. Omitting targetType, or providing the wrong script input, fails validation. The bash: shorthand avoids the boilerplate for inline scripts.
What this error means
The pipeline rejects the Bash@3 step with a required-input error for targetType, script, or filePath. The step never executes because the task contract is incomplete.
##[error]A value for the 'targetType' parameter is required.
##[error]Input required: scriptCommon causes
Missing targetType on Bash@3
The full Bash@3 task requires targetType. Without it, the task does not know whether to run an inline script or a filePath, and validation fails.
Script input does not match targetType
targetType: inline needs script; targetType: filePath needs filePath. Supplying the wrong one (or neither) is rejected.
How to fix it
Provide targetType and the matching input
Set targetType and the corresponding script source.
steps:
- task: Bash@3
inputs:
targetType: inline
script: |
set -euo pipefail
npm testPrefer the bash shorthand for inline scripts
The bash: step is the inline Bash@3 with no targetType boilerplate.
steps:
- bash: |
set -euo pipefail
npm test
displayName: TestHow to prevent it
- Use the
bash:shorthand for inline scripts to avoid missing-input errors. - When using
Bash@3, always settargetTypeand the matching script input. - Validate the pipeline so required-input gaps surface before a run.