10up / wpcs-action

GitHub Action to help you lint your PHP without additional dependencies within your codebase
MIT License
54 stars 13 forks source link

Deprecation error #22

Closed ghost closed 1 year ago

ghost commented 1 year ago

Describe the bug

Here's my yml:

name: WordPress Coding Standards checks

on: push

jobs:
  phpcs:
      name: WPCS
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v2
        - name: WPCS check
          uses: 10up/wpcs-action@stable

This action is giving error: <error line="1" column="1" severity="error" message="An error occurred during processing; checking has been aborted. The error message was: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /github/home/wpcs/WordPress/Sniffs/WP/I18nSniff.php on line 194" source="Internal.Exception"/>

Screenshot_1

I tried running the sniffer using older versions of PHP (7.2 and 7.4) with no luck. shivammathur/setup-php@v2 was used to switch PHP version in yml file.

The sniffer was working fine about 2-3 months ago.

Steps to Reproduce

  1. Add workflow config in .yml file
  2. Push test changes
  3. Error!
peterwilsoncc commented 1 year ago

Thanks for the report @azamat-bs

This has been fixed in pull request #20 and will be included in the next release.

You can be notified of the next release via the "watch" dropdown at the top of this page. You can select "custom" and check the releases option to be notified only of releases.

The team is aiming to get a release out soon as this is affecting a number of people but we don't have an exact ETA at the moment.

Thanks again for getting in touch.

peterwilsoncc commented 1 year ago

A new release, version 1.4.0, has been tagged to fix this issue.

I'll close this issue as resolved.