From 604fff9b720f32553b31a986ecd2216f85764075 Mon Sep 17 00:00:00 2001 From: Ronald Huereca Date: Tue, 30 Jan 2024 02:27:28 -0600 Subject: [PATCH] Adding GitHub action. --- .github/workflows/wpcs.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/wpcs.yml diff --git a/.github/workflows/wpcs.yml b/.github/workflows/wpcs.yml new file mode 100644 index 0000000..7213dd2 --- /dev/null +++ b/.github/workflows/wpcs.yml @@ -0,0 +1,28 @@ +name: WPCS check + +on: pull_request + +jobs: + phpcs: + name: WPCS + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: WPCS check + uses: 10up/wpcs-action@stable + with: + enable_warnings: false # Enable checking for warnings (-w) + paths: '.' # Paths to check, space separated + excludes: '' # Paths to excludes, space separated + standard: 'WordPress' # Standard to use. Accepts WordPress|WordPress-Core|WordPress-Docs|WordPress-Extra|WordPress-VIP-Go|WordPressVIPMinimum|10up-Default. + standard_repo: '' # Public (git) repository URL of the coding standard + repo_branch: 'master' # Branch of Standard repository + phpcs_bin_path: 'phpcs' # Custom PHPCS bin path + use_local_config: 'false' # Use local config if available + extra_args: '--report-json=./phpcs.json' + - name: Update summary + run: | + npm i -g github:10up/phpcs-json-to-md + phpcs-json-to-md --path ./phpcs.json --output ./phpcs.md + cat phpcs.md >> $GITHUB_STEP_SUMMARY + if: always() \ No newline at end of file