(feat): test coverage #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Format PHP | |
on: | |
pull_request: | |
paths: | |
- '**.php' | |
jobs: | |
php-cs-fixer: | |
runs-on: ubuntu-latest | |
needs: what-has-changed | |
# Run only if PHP files have changed | |
if: ${{ needs.what-has-changed.outputs.php == 'true' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Run php-cs-fixer | |
uses: docker://oskarstark/php-cs-fixer-ga | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "(auto): apply php-cs-fixer changes" | |
push_options: "--force" | |
env: | |
GITHUB_TOKEN: ${{ secrets.YARD_BOT_PAT }} | |
# Job to check if certain files have changed | |
what-has-changed: | |
name: Detect file changes | |
runs-on: ubuntu-latest | |
outputs: | |
php: ${{ steps.filter.outputs.php }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# For pull requests it's not necessary to checkout the code | |
if: ${{ github.event_name != 'pull_request' }} | |
- uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
base: ${{ github.ref }} | |
filters: | | |
php: | |
- added|modified: '*.php' |