mirror of
https://github.com/OPSnet/monerophp.git
synced 2026-11-09 17:39:22 -10:00
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
name: Run PHP CodeSniffer
|
|
|
|
# Run PHPCBF to fix changes then annotate PHPCS
|
|
# NB: Pull requests from forks do not have access to repository secrets so cannot commit changes.
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
php-codesniffer:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
# Give the default GITHUB_TOKEN write permission to commit and push the
|
|
# added or changed files to the repository.
|
|
contents: write
|
|
|
|
strategy:
|
|
matrix:
|
|
php: [ '8.0' ]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
tools: composer, cs2pr
|
|
extensions: zip
|
|
|
|
- name: Run composer install
|
|
continue-on-error: true
|
|
run: composer install
|
|
|
|
- name: Run PHPCBF to fix what it can
|
|
continue-on-error: true
|
|
run: vendor/bin/phpcbf
|
|
|
|
- name: Run PHPCS to add annotations to the code
|
|
continue-on-error: true
|
|
run: vendor/bin/phpcs -q -n --report=checkstyle | cs2pr
|
|
|
|
- name: Commit PHPCBF changes
|
|
uses: stefanzweifel/git-auto-commit-action@v4
|
|
with:
|
|
commit_message: "🤖 PHPCBF"
|
|
|