tools input accepts a comma-separated list of tools to install globally. This is useful for CI-only tools that you do not want to commit to your composer.json.
Basic usage
Supported tools
The following tools can be installed by name:Tool version specification
Specify a version by appending:version to the tool name:
- Semver —
tool:1.2.3ortool:1.2.3-beta1 - Major only —
tool:1ortool:1.x(installs latest patch in that major) - Major.minor —
tool:1.2ortool:1.2.x(installs latest patch in that minor)
Composer version options
The latest stable Composer is installed by default. You can pin a specific version:- Composer v1
- Composer v2
- Snapshot / preview
prestissimo and composer-prefetcher are skipped unless composer:v1 is also specified. It is recommended to drop prestissimo and use Composer v2 instead.Installing arbitrary Composer packages
Any package on Packagist can be installed globally by specifying it asvendor/package. This format accepts the same version constraints as Composer:
Skipping Composer installation
If you do not use Composer in your workflow, specifytools: none to skip its installation:
Default tools on Linux and macOS
pear, pecl, phpize, and php-config are installed by default for all supported PHP versions on Linux and macOS. You do not need to list them in the tools input.
Composer environment variables
Setup-php sets the following Composer environment variables automatically:
Override any of these in your workflow’s
env block:
Allowing Composer plugins
Composer blocks all plugins by default. Tools installed via thetools input are automatically added to the allow list. If your dependencies include Composer plugins, allow them with COMPOSER_ALLOW_PLUGINS:
Fail-fast behavior
By default (except forcomposer itself), tools that cannot be set up leave an error message in the logs without interrupting the workflow. Set fail-fast to make the workflow fail instead: