-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
DX: Fix SCA with PHPMD #5829
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
DX: Fix SCA with PHPMD #5829
Conversation
|
thanks for the research 👍 |
e8641c8 to
55d5511
Compare
|
The 2nd commit shows that phpmd is now being called whenever there are changed PHP files, so the added sample file can now be deleted. |
|
can you re-add the test file again to show how phpmd is kicking off now? |
59441f0 to
7617921
Compare
|
I think the failing CI is unrelated, or not? |
|
i think we are ready to merge @paulbalandan ? if so, pls drop the test file and if CI still green, let's merge |
|
Thank you @paulbalandan. |
I found the SCA workflow here using PHPMD very useful and applied it in one of my projects. However, I noted that the actual fixing part with PHPMD is never run. I checked with the actions runs here and it seems the same is true. So after a lot of trial and error fixing the syntax, I found a solution at least working for me and wished to share here.
The problems are:
git diffwithgrepis never saved to$GITHUB_ENV, even though there are changed PHP files. This is maybe because of the|| truepart.Check - phpmdstep has a condition to runif: ${{ github.env.CHANGED_PHP_FILES }}. The problem here is that thegithubcontext does not have theenvproperty. Rather, theenvis a context of its own. See https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#env-context