Conversation
|
There was a problem hiding this comment.
Pull request overview
This PR updates the repository’s static analysis GitHub Actions workflow to use a unified reusable workflow and to pass a precomputed PHPStan matrix via job outputs, while also adding workflow-level concurrency to avoid overlapping runs.
Changes:
- Add workflow-level concurrency to cancel in-progress runs for the same branch/PR.
- Rename and reshape the matrix output to
phpstan_matrix(JSON{ include: [...] }) and pass it into the reusable workflow. - Switch from
reusable-static-analysis-centralized.yamltoreusable-static-analysis-unified.yamland add new CI-related secrets/options.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if [ -f composer.json ]; then | ||
| php_versions=$(jq -r '.require.php' composer.json | grep -oP '\d+\.\d+' | tr '\n' ',' | sed 's/,$//') | ||
| if [ -z "$php_versions" ]; then | ||
| echo "No PHP versions found in composer.json" | ||
| echo "Setting default PHP value" | ||
| echo "php_versions=default" >> $GITHUB_OUTPUT | ||
| echo "php_versions=default" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "php_versions=$php_versions" >> $GITHUB_OUTPUT | ||
| echo "#### php versions #### : $php_versions" | ||
| echo "php_versions=$php_versions" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
The PHP version parsing regex (grep -oP '\d+\.\d+') will incorrectly extract patch parts as separate versions for constraints like this repo’s "php": "~8.3.0 || ~8.4.0" (it yields 8.3,3.0,8.4,4.0). This will likely produce an invalid/empty matrix selection downstream. Consider extracting full major.minor.patch tokens first (e.g., \d+\.\d+\.\d+) and then normalizing to major.minor, or otherwise parsing Composer constraints more robustly.
| echo "#### php versions #### : $php_versions" | ||
| echo "php_versions=$php_versions" >> "$GITHUB_OUTPUT" | ||
| fi | ||
| else |
There was a problem hiding this comment.
When composer.json is missing, the step exits with status 1 but prints no error message. Adding a short message to stderr before exiting would make failures easier to diagnose in CI logs.
| else | |
| else | |
| echo "Error: composer.json not found; cannot parse PHP versions." >&2 |



This pull request updates the static analysis GitHub Actions workflow to improve matrix handling and workflow execution. The main changes focus on how PHP version matrices are parsed and passed to the reusable workflow, as well as updating the workflow to use a unified static analysis workflow file. Additional secrets and options have also been added for improved CI configuration.
Workflow matrix and execution improvements:
phpstan_matrixinstead of the previousmatrix, and changed the filtering logic to better handle PHP version selection and matrix inclusion (.github/workflows/static-analysis.yaml). [1] [2]reusable-static-analysis-unified.yamlworkflow instead of the olderreusable-static-analysis-centralized.yaml, and updated the inputs to match the new matrix structure (.github/workflows/static-analysis.yaml).Concurrency and CI configuration:
.github/workflows/static-analysis.yaml)..github/workflows/static-analysis.yaml).REQUIRE_ADMIN_BUNDLEandCOVERAGEto further control analysis behavior (.github/workflows/static-analysis.yaml).