IN clause support added to update method and sanitize mapping added to insert method #2390
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: WPCS check | |
on: pull_request | |
jobs: | |
phpcs: | |
name: WPCS | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fetch All Branches | |
run: git fetch --all --prune | |
- name: Set target branch | |
id: target-branch | |
run: echo "::set-output name=target_branch::dev" | |
- name: Check Changed Files | |
id: changed-files | |
run: | | |
echo "::set-output name=files::$(git diff --name-only --diff-filter=ACMRTUXB origin/${{ steps.target-branch.outputs.target_branch }}...origin/${{ github.head_ref }} | grep \\.php$ | tr '\n' ' ')" | |
- name: Changed File Print | |
run: echo "${{ steps.changed-files.outputs.files }}" | |
- name: Total File Changed | |
id: count-files | |
run: | | |
# Extract the files from the 'changed-files' output variable | |
files="${{ steps.changed-files.outputs.files }}" | |
# Count the number of .php files | |
file_count=$(echo "$files" | tr ' ' '\n' | grep -E '\.php$' | wc -l | xargs) | |
echo "$file_count" | |
# Set an environment variable with the total .php file count | |
echo "TOTAL_PHP_FILES=$file_count" >> $GITHUB_ENV | |
- name: WPCS Check | |
if: ${{ env.TOTAL_PHP_FILES > 0 }} | |
uses: 10up/wpcs-action@stable | |
with: | |
repo_branch: "${{ steps.target-branch.outputs.target_branch }}" # Branch of Standard repository | |
paths: "${{ steps.changed-files.outputs.files }}" # Paths to check, space separated like ./views ./classes ./models | |
excludes: '' # Paths to excludes, space separated | |
standard: './phpcs.xml.dist' # Coding standard | |
use_local_config: 'false' # Use local config if available | |
enable_warnings: 'false' # Enable checking for warnings (-w) | |
extra_args: '-d error_reporting="E_ALL&~E_DEPRECATED"' |