-
-
Notifications
You must be signed in to change notification settings - Fork 15
Getting error: /usr/local/bin/phpstan: line 2: syntax error: unexpected newline #10
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
Comments
Hi @bshaffer , Thanks for raising this issue. I'll take a look into it for you later. In the meantime, would you be able to compare to https://github.com/php-actions/example-phpstan as a known working project? Thanks, |
I ended up calling the binary directly instead of using this action |
Interesting. It would still be useful to use this action, so you can get your builds a lot quicker than 2 minutes. For debugging's sake, would you be able to delete the packages created on the repo here: https://github.com/orgs/GoogleCloudPlatform/packages?repo_name=php-docs-samples and then try again? I'm wondering whether there was a build error and something fishy has been cached. |
@g105b done. Why would this be generating packages though? |
It builds the PHP environment and PhpStan project, and caches the packages on the repository to achieve builds that only take a few seconds to execute. At the time of ghcr.io being a new deal, this was the only way to do it (storing packages on the repository, rather than within php-actions organisation). I'm open to other ways of working. Did the removal fix the issue for you? |
Because the repo I'm in has to run in multiple subdirectories (we have ~30 sample directories, each with their own Previously I was splitting it out into 30 separate jobs, but this was more trouble than it's worth (the job was generating 30 individual checks that diluted the more important unit test checks). I do not believe it's current form (looping through all relevant directories and running If I'm wrong and this use-case is supported, please let me know! |
Thank you for the update, Brent. This is certainly something I will pay some attention to, as I'd like this action to be as accessible as possible to everyone. Running an individually-installed
I understand that this might not satisfy your particular use case, but I thought it was worth sharing. I'll close this issue now but feel free to continue the discussion - always happy to help. |
Let me just add $0.03 here and point out that proposed - name: PHPStan
uses: php-actions/phpstan@v3
with:
path: example/dir1 example/dir2 example/dir3 ...etc. is counter intuitive, as in yaml you should do normal list instead path:
- example/dir1example/dir2
- example/dir2
- example/dir3
- ...etc |
Thank you @MarcinOrlowski . I've just opened issue #15 to track this. |
@g105b I've been experiencing the same issue, and I believe it's due to certain versions not being available on https://www.getrelease.download/, which you use in the bash script. For example, I need PHPStan version 1.8, but looking at the available releases, nothing before 1.9.0 is available. As to why those versions are no longer available, I don't know. I've raised a discussion here (phpstan/phpstan#9116). |
Thank you, I'll see if I can resolve as soon as I'm back home next week. |
Thanks, although I'm not sure there is much you can do, it's the Github API not returning all the releases (https://api.github.com/repos/phpstan/phpstan/releases). Thanks anyway! |
Had the same issue, |
Hi all, You may not be aware but I also maintain and contribute to the https://getrelease.download service (https://github.com/g105b/getrelease.download) - if it's this service that's not playing well when Github's APIs have an issue, it may be worth checking out where it's failing to fix it at the source. I think what was happening was the Github API had a short outage, and getrelease.download tried to supply a non-existent release, which when executed in the Github Action, came back with the error message "/usr/local/bin/phpstan: line 2: syntax error: unexpected newline" (because it was probably trying to execute just an HTML error 404 page). Please raise an issue over at the getrelease.download repo if this problem occurs, or if you want to track it there instead. Thanks! |
When I use this action to run
phpstan
in my github actions, I get the following error:Looking at the debug output, this is from the following command (which run locally, executes as expected):
You can see the full run log here
I have also tried setting the PHP version to 7.4 for both the composer action and the phpstan action, with no luck.
Any thoughts?
The text was updated successfully, but these errors were encountered: