Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to install a non-existent version of PHP does not give an error #368

Closed
2 of 5 tasks
timhunt opened this issue Dec 16, 2020 · 2 comments
Closed
2 of 5 tasks
Assignees
Labels
bug Something isn't working

Comments

@timhunt
Copy link

timhunt commented Dec 16, 2020

Describe the bug
Action reports success even if the version of PHP you ask for does not exist.

Version

  • I have checked releases, and the bug exists in the latest patch version of v1 or v2.
  • v2
  • v1

Runners

  • GitHub Hosted
  • Self Hosted

Operating systems
ubuntu-latest (Ubuntu 18.04.5)

PHP versions
I was trying to use 7.5, which does not currently exist in the Ubuntu 18.04.5 images.

To Reproduce

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: 7.5
          extensions: mbstring, pgsql, mysqli

Expected behavior
Either I get PHP 7.5, or the Step fails with a clear error message, so it is easy to see why my build failed.

Actual behavior
Script tries to continue with PHP 8.0.0, and then fails later because that is not yet supported, but the error message is not very obvious.

Screenshots/Logs

Run shivammathur/setup-php@v2
  with:
    php-version: 7.5
    extensions: mbstring, pgsql, mysqli
/bin/bash /opt/hostedtoolcache/linux.sh 7.5 /home/runner/work/_actions/shivammathur/setup-php/v2/dist

==> Setup PHP
/home/runner/work/_actions/shivammathur/setup-php/v2/dist/../src/scripts/common.sh: line 250: php7.5: command not found
✓ PHP Installed PHP 

==> Setup Tools
✓ composer Added composer 2.0.8

==> Setup Extensions
✓ mbstring Enabled
✓ pgsql Enabled
✓ mysqli Enabled

==> Support this project
✓ setup-php https://setup-php.com/support

Note, in particular, the like that says ✓ PHP Installed PHP which is not really right. (The line above is a helpful message.)

Additional context
Thank you very much for making this step and sharing it. Obviously, now that I see what the problem is, i can work around it (don't ask for PHP 7.5 when it does not exist!) so fixing this is not urgent. I just wanted to make you aware of the issue I had spotted.

Are you willing to submit a PR?
Sorry, I am quite new to GitHub actions. I am unlikely to try to submit a fix any time soon.

@timhunt timhunt added the bug Something isn't working label Dec 16, 2020
@shivammathur
Copy link
Owner

Fixed in ce02569

@timhunt
Copy link
Author

timhunt commented Dec 17, 2020

Brilliant! Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants