An open API service indexing awesome lists of open source software.

https://github.com/nxtlvlsoftware/setup-phpstan-action

GitHub action for installing PHPStan in workflows.
https://github.com/nxtlvlsoftware/setup-phpstan-action

Last synced: 3 months ago
JSON representation

GitHub action for installing PHPStan in workflows.

Awesome Lists containing this project

README

        

# Action nxtlvlsoftware/setup-phpstan-action

GitHub action for installing [PHPStan](https://github.com/phpstan/phpstan) in actions workflows.

- [x] Allows passing version string and installing from github releases into path/env.
- [x] Allows passing existing executable path and installing into path/env.
- [x] Supports caching for version string and existing binary installations.

| Action Input | Required | Default | Description |
| ------------ | -------- | -------- | ------------------------------------------------------------------------------------- |
| install-path | true | | The path to install PHPStan binary to. |
| version | false | latest | The target PHPStan version to install. Exact versions only (8.0.11, 7.4.24, etc.) |
| path | false | false | Path to an existing PHPStan installation. |

Either `version` or `path` must be specified.

## How to use
Attempt to download any PHPStan release by providing the version:

```yml
name: My PHPStan Workflow
on: [push]
jobs:
setup-phpstan:
name: Setup PHPStan
runs-on: ubuntu-latest
steps:
- uses: nxtlvlsoftware/setup-phpstan-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
version: '1.8.2'
install-path: './bin'
```

Forwarding the `$GIHUB_TOKEN` environment variable is required to properly configure PHPStan as we
interact with the GitHub API to fetch version information.

Or provide the path to an existing PHPStan installation/binary:
```yml
name: My PHPStan Workflow
on: [push]
jobs:
setup-phpstan:
name: Setup PHPStan
runs-on: ubuntu-latest
steps:
- uses: nxtlvlsoftware/setup-phpstan-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: 'path/to/your/phpstan.phar'
install-path: './bin'
```

## License
`nxtlvlsoftware/setup-phpstan-action` is open-sourced software licensed under the [MIT license](LICENSE).