Add CI workflow and Dependabot configuration#4
Conversation
- CI: PHP 8.2 syntax check on all .php files - Dependabot: github-actions weekly updates
There was a problem hiding this comment.
Pull request overview
Adds basic automation to the repo via GitHub Actions CI and Dependabot, aiming to keep GitHub Actions dependencies updated and to gate changes on a PHP syntax check.
Changes:
- Add a GitHub Actions workflow to run a PHP 8.2 syntax lint across repository
.phpfiles (excludingvendor/). - Add a Dependabot configuration for weekly
github-actionsupdates.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Introduces a CI workflow intended to run php -l against all PHP files on pushes/PRs to main. |
.github/dependabot.yml |
Enables weekly Dependabot PRs for GitHub Actions dependency updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| php-version: "8.2" | ||
|
|
||
| - name: Check PHP syntax | ||
| run: find . -name "*.php" -not -path "./vendor/*" -exec php -l {} \; |
There was a problem hiding this comment.
The find ... -exec php -l ... \; command does not cause the step to fail when php -l returns a non-zero status (find's overall exit code is based on find errors, not predicate results). As a result, PHP syntax errors may not fail CI. Update the step to explicitly propagate failures (e.g., loop over files with set -e, or pipe find -print0 into xargs and rely on xargs' non-zero exit).
| run: find . -name "*.php" -not -path "./vendor/*" -exec php -l {} \; | |
| run: find . -name "*.php" -not -path "./vendor/*" -print0 | xargs -0 -n1 php -l |
| branches: [main] | ||
|
|
||
| jobs: | ||
| php-syntax: |
There was a problem hiding this comment.
Consider adding an explicit permissions: block (e.g., contents: read) to the workflow/job. GitHub Actions defaults can be broader than necessary and explicit minimal permissions helps avoid future permission-related breakages and follows GitHub's recommended hardening guidance.
| php-syntax: | |
| php-syntax: | |
| permissions: | |
| contents: read |
Changes