Azure-Pipelines – ShellCheck Wiki

See this page on GitHub


ShellCheck is installed by default on the ubuntu-latest host in Azure Pipelines. To see all installed software, consult the Azure documentation.


Trying to run ShellCheck as usual within the pipeline will produce an error:

$ shellcheck myscripts/*.sh
myscripts/*.sh: myscripts/*.sh: openBinaryFile: does not exist (No such file or directory)

The recommended approach is to use find to search the files and pass a list of those to ShellCheck:

$ shellcheck $(find $(pwd)/myscripts/ -name "*.sh")

Example pipeline

Copy the following YAML to run ShellCheck in Azure Pipelines against all *.sh files in the current directory:

- master

- job: shellcheck
  displayName: ShellCheck
    vmImage: 'ubuntu-latest'

  - script: shellcheck $(find $(pwd) -name "*.sh")
    displayName: 'Running ShellCheck'

ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.