Merge pull request #8511 from Sesquipedalian/3.0/revert_lock_actions #829
This file contains hidden or 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
| on: | |
| push: | |
| branches: | |
| - release-3.0 | |
| pull_request: | |
| name: PHP Check | |
| jobs: | |
| php-cs-fixer: | |
| name: PHP-CS-Fixer | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Get changed files | |
| id: changed-files | |
| run: | | |
| if ${{ github.event_name == 'pull_request' }}; then | |
| echo "all_changed_files_count=$(git diff --name-only -r HEAD^1 HEAD | xargs | grep '\.php$')" >> $GITHUB_OUTPUT | |
| else | |
| echo "all_changed_files_count=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | xargs | grep '\.php$')" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Get extra arguments for PHP-CS-Fixer | |
| id: phpcs-intersection | |
| run: | | |
| CHANGED_FILES=$(echo "${{ steps.changed-files.outputs.all_changed_files_count }}" | tr ' ' '\n') | |
| if echo "${CHANGED_FILES}" eq "1"; then CHANGED_FILES=""; fi | |
| if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php-cs-fixer(\\.dist)?\\.php|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection\n--\n%s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi | |
| echo "PHPCS_EXTRA_ARGS<<EOF" >> $GITHUB_ENV | |
| echo "$EXTRA_ARGS" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| - name: PHP-CS-Fixer | |
| uses: docker://oskarstark/php-cs-fixer-ga | |
| with: | |
| args: --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no ${{ env.PHPCS_EXTRA_ARGS }} |