Closed svenluijten closed 1 year ago
Please use ${{ env.GLOBAL_PHP_EXTENSIONS }}
and ${{ env.LOCAL_PHP_EXTENSIONS }}
, then it will pass the actual env value.
Well that's confusing that it only breaks in Windows runners! But yep, that seems to have fixed the issue. Thanks for the (insanely!) quick response @shivammathur! 😄
Describe the bug When using a Windows runner to setup PHP, it does not expand environment variables. Instead, it passes the name of the variable as a string through to
extensions
.I've reproduced the issue here (run with debug logging enabled) so you can see what happens. I'll gladly assist in any way I can to get this resolved.
Version
v1
orv2
.v2
v1
Runners
Operating systems
Windows (
latest
, at time of submitting issue)PHP versions
Supposedly all, but tested on 8.1 and 8.2.
To Reproduce
https://github.com/svenluijten/setup-php-issue/blob/main/.github/workflows/run.yml. Pasted below for posterity. I've verified all three different syntaxes as valid, as it works on
macos-latest
as well asubuntu-latest
. The GitHub documentation also states that this is possible.Workflow file
```yml name: Run on: [push] env: GLOBAL_PHP_EXTENSIONS: mbstring, fileinfo jobs: run-with-global-env: name: Using global env runs-on: windows-latest steps: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: php-version: 8.2 extensions: $GLOBAL_PHP_EXTENSIONS coverage: none - name: Install dependencies run: composer install run-with-local-env: name: Using local env runs-on: windows-latest env: LOCAL_PHP_EXTENSIONS: mbstring, fileinfo steps: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: php-version: 8.2 extensions: $LOCAL_PHP_EXTENSIONS coverage: none - name: Install dependencies run: composer install run-without-env: name: Without env var runs-on: windows-latest steps: - uses: actions/checkout@v3 - uses: shivammathur/setup-php@v2 with: php-version: 8.2 extensions: mbstring, fileinfo coverage: none - name: Install dependencies run: composer install ```Expected behavior I expect the
mbstring
andfileinfo
extensions to be loaded.Screenshots/Logs
The above is copied from my reproduction repository.
Additional context I'm actually unsure if this is an issue with
setup-php
specifically, or if it is more of a GitHub-issue with their Windows runners. Some pointers would be helpful 🙂Are you willing to submit a PR? I'll help any way I can, but I am not intimately familiar with the inner workings of GitHub Actions (let alone PowerShell, which the setup script for Windows runners is written in.