Skip to content
Latchkey

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.

Azure DevOps
##[error]A value for the 'targetType' parameter is required.
##[error]Input required: script

Common 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.

azure-pipelines.yml
steps:
  - task: Bash@3
    inputs:
      targetType: inline
      script: |
        set -euo pipefail
        npm test

Prefer the bash shorthand for inline scripts

The bash: step is the inline Bash@3 with no targetType boilerplate.

azure-pipelines.yml
steps:
  - bash: |
      set -euo pipefail
      npm test
    displayName: Test

How to prevent it

  • Use the bash: shorthand for inline scripts to avoid missing-input errors.
  • When using Bash@3, always set targetType and the matching script input.
  • Validate the pipeline so required-input gaps surface before a run.

Frequently asked questions

What causes ""targetType is required""?
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.
How do I fix "targetType is required"?
Set targetType and the corresponding script source.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card