Automattic / themes

Free WordPress themes made by Automattic for WordPress.org and WordPress.com.
https://themeshaper.com
GNU General Public License v2.0
903 stars 357 forks source link

Fix theme validation and theme check workflow errors #8198

Closed madhusudhand closed 1 month ago

madhusudhand commented 1 month ago

Changes proposed in this Pull Request:

Theme Validation workflow

  1. This PR includes style.css changes as PR paths to validate. Without it, the validation workflow doesn't not validate themes with style.css only changes.

  2. Also fixes minor issue where args is empty array.

 file:///home/runner/work/themes/themes/theme-utils.mjs:148
            while ( args[ 0 ].startsWith( '--' ) ) {
                              ^

TypeError: Cannot read properties of undefined (reading 'startsWith')

Theme Check workflow

It fixes the following issue with theme check workflow (also simplifies the directory finding logic)

Run IFS=',' read -ra FOLDERS <<< ".github"
Processing theme folder: .github
ℹ Starting 'wp theme activate .github' on the cli container. 

Error: The '.github' theme could not be found.
✖ Command failed with exit code 1
Command failed with exit code 1
Error: Process completed with exit code 1.

Testing instructions:

A test PR #8199 should run successfully. Please add any other scenarios to validate.