psalm / psalm-github-security-scan

Psalm Security Scanning for GitHub Actions
53 stars 17 forks source link

need working-directory param #3

Closed fox-john closed 1 year ago

fox-john commented 1 year ago

My github repository is a monorepository, and my composer.json are in subdirectory. With this actual configuration, psalm return an error :

composer.json not found in repo, skipping Composer installation
Psalm 4.4.1@9fd7a7d885b3a216cff8dec9d8c21a132f275224
Uncaught Psalm\Exception\ConfigCreationException: Problem during config autodiscovery - could not find composer.json during initialization. in /composer/vendor/vimeo/psalm/src/Psalm/Config/Creator.php:179

We need a working-directory variable for this, at this line:

https://github.com/psalm/psalm-github-security-scan/blob/4905d245e279c88ee745d39d5b8cf598429b6e48/entrypoint.sh#L9

orklah commented 1 year ago

Seems weird that Psalm 4.4 is installed. I'd expect Psalm 5 to be retrieved (there were some changes since, at least on the error message so it may be already fixed)

austenstone commented 1 year ago

I'm having exactly the same error https://github.com/austenstone/advanced-security-php/actions/runs/4046963026/jobs/6960406264

composer.json not found in repo, skipping Composer installation
Psalm [4](https://github.com/austenstone/advanced-security-php/actions/runs/4046963026/jobs/6960406264#step:4:5).4.1@9fd7a7d88[5](https://github.com/austenstone/advanced-security-php/actions/runs/4046963026/jobs/6960406264#step:4:6)b3a216cff8dec9d8c21a132f275224
Uncaught Psalm\Exception\ConfigCreationException: Problem during config autodiscovery - could not find composer.json during initialization. in /composer/vendor/vimeo/psalm/src/Psalm/Config/Creator.php:179
Stack trace:
#0 /composer/vendor/vimeo/psalm/src/Psalm/Config/Creator.php(55): Psalm\Config\Creator::getPaths('/github/workspa...', NULL)
#1 /composer/vendor/vimeo/psalm/src/Psalm/Config/Creator.php(91): Psalm\Config\Creator::getContents('/github/workspa...', NULL, 1, 'vendor')
#2 /composer/vendor/vimeo/psalm/src/command_functions.php(485): Psalm\Config\Creator::createBareConfig('/github/workspa...', NULL, 'vendor')
#3 /composer/vendor/vimeo/psalm/src/psalm.php(359): Psalm\initialiseConfig(NULL, '/github/workspa...', 'github', Object(Composer\Autoload\ClassLoader), true)
#4 /composer/vendor/vimeo/psalm/psalm(2): require_once('/composer/vendo...')
#5 {main}
(Psalm 4.4.1@9fd[7](https://github.com/austenstone/advanced-security-php/actions/runs/4046963026/jobs/6960406264#step:4:8)a7d[8](https://github.com/austenstone/advanced-security-php/actions/runs/4046963026/jobs/6960406264#step:4:9)85b3a216cff8dec[9](https://github.com/austenstone/advanced-security-php/actions/runs/4046963026/jobs/6960406264#step:4:10)d8c21a[13](https://github.com/austenstone/advanced-security-php/actions/runs/4046963026/jobs/6960406264#step:4:14)2f275224 crashed due to an uncaught Throwable)