You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The action creates .wp-env.json in the repository root during setup, but when build-dir defaults to ./, Plugin Check's hidden_files check flags it as an error—a false positive since this file only exists during CI and isn't distributed with the plugin.
Changes
Modified the "Set PLUGIN_DIR" step in action.yml to check if .wp-env.json already exists in the plugin directory and store the result in the WP_ENV_JSON_EXISTS environment variable
Modified the "Run Plugin Check" step in action.yml to conditionally append .wp-env.json to the --exclude-files parameter only if it was created by the action
Handles both cases: when users provide their own exclude-files list (appends to it) and when they don't (creates new list)
# Only exclude .wp-env.json if it was created by this action (didn't exist before)if [ "$WP_ENV_JSON_EXISTS"="false" ];thenif [ -n"$EXCLUDE_FILES" ];then
EXCLUDE_FILES="--exclude-files=${EXCLUDE_FILES#--exclude-files=},.wp-env.json"else
EXCLUDE_FILES="--exclude-files=.wp-env.json"fifi
This ensures that:
If a plugin legitimately has a .wp-env.json file as part of its codebase, it will be checked by Plugin Check
If .wp-env.json doesn't exist and is created by the action, it will be excluded from checks to avoid false positives
Original prompt
This section details on the original issue you should resolve
<issue_title>The hidden_files check errors on .wp-env.json which is created by the action</issue_title>
<issue_description>Here's the red error that I'm getting:
hidden_files: .wp-env.json#L0
Hidden files are not permitted.
I might be able to suppress the error myself, but it seems like this means that everyone running the default configuration is getting this error? Thank you for checking! ❤️ </issue_description>
Comments on the Issue (you are @copilot in this section)
@swissspidy
How are you using the GitHub Action in your repo? I assume you don't use the `build-dir` option?
CopilotAI
changed the title
[WIP] Fix hidden files check error for .wp-env.json
Exclude .wp-env.json from Plugin Check to prevent false positive hidden_files error
Jan 4, 2026
@copilot There could already be a .wp-env.json file in the plugin under test, in which case it shouldn't be excluded. So perhaps first check if it exists (before the "Setup wp-env" step)
@copilot There could already be a .wp-env.json file in the plugin under test, in which case it shouldn't be excluded. So perhaps first check if it exists (before the "Setup wp-env" step)
Good catch! I've updated the logic to check if .wp-env.json exists in the plugin directory before the action creates one. Now it only excludes the file if it was created by the action (commit a0ed182). If a plugin already has .wp-env.json, it will be properly checked by Plugin Check.
CopilotAI
changed the title
Exclude .wp-env.json from Plugin Check to prevent false positive hidden_files error
Conditionally exclude .wp-env.json from Plugin Check to prevent false positive hidden_files error
Jan 5, 2026
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The action creates
.wp-env.jsonin the repository root during setup, but whenbuild-dirdefaults to./, Plugin Check'shidden_filescheck flags it as an error—a false positive since this file only exists during CI and isn't distributed with the plugin.Changes
action.ymlto check if.wp-env.jsonalready exists in the plugin directory and store the result in theWP_ENV_JSON_EXISTSenvironment variableaction.ymlto conditionally append.wp-env.jsonto the--exclude-filesparameter only if it was created by the actionThis ensures that:
.wp-env.jsonfile as part of its codebase, it will be checked by Plugin Check.wp-env.jsondoesn't exist and is created by the action, it will be excluded from checks to avoid false positivesOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.