-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitHub Actions: Fix PHP file change detection filter pattern #61183
Conversation
This pull request changed or added PHP files in previous commits, but none have been detected in the latest commit. Thank you! ❤️ |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this update, @t-hamano! I have one suggestion:
Co-authored-by: Brian Alexander <[email protected]>
Size Change: 0 B Total Size: 1.74 MB ℹ️ View Unchanged
|
@ironprogrammer Thanks for the review! I made changes to some files after surrounding the pattern with quotes, but the file changes are no longer detected.
After that, when I deleted the quote, the change was detected successfully.
When I checked the README of the actual action, I found the following statement.
Therefore, quotes may not be necessary for this action. |
In response to @t-hamano:
Ah, interesting -- good to know! |
@t-hamano, what do you think about addressing the intent behind the directory filters that were originally introduced in 3c34c48? The workflow's intent is stated as, "Confirm if PHP changes require backporting to WordPress Core", but this could include other file types that should be reviewed and/or synced. E.g. something like this: files: |
lib/**
packages/**/*.php
phpunit/** This update would isolate changes in repo locations that are known to be sync points or otherwise affect Core, including PHP changes in packages, and non-PHP assets (e.g. images and fonts for unit tests, etc). (I also discussed the possibility of a |
Yes, this pattern could be improved. I understand the background behind the introduction of this GitHub Actions, but it was updated to purely catch all PHP file changes (see this discussion) However, there are files other than PHP files that need to be backported to core, such as For example, how about targeting all PHP files and all files in the lib directory as shown below?
|
Thanks for sharing that discussion. I guess it should be reconciled to clarify whether any PHP file change in the Gutenberg repo is intended here (including plugin-specific code in the root, The docs for Back-merging code to WordPress Core call out Additionally, I'd argue that PHP changes to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good, and it would be useful to have the workflow functioning again after so long.
The rules can be more finely tuned as needed after contributors have had some time with this update.
Fixed regression caused by #59653
What?
I've noticed that PRs that include changes to PHP files don't automatically have a comment added to encourage them to backport to the core. This PR ensures that GitHub Actions correctly detects PHP changes and that the GitHub Actions adds a comment.
Below are examples of PRs showing that this Props Bot was not working.
textAlign
block support #59531Why?
In #59653, We changed the filter pattern as follows.
According to the documentation, curly brackets cannot be allowed as a pattern. In other words, it seems that the pattern
.{php}
did not originally work. As a result, it seems that file changes are no longer detected at all.How?
Removed curly brackets. This should now detect changes to all PHP files.
Testing Instructions
By e81c37a I temporarily made changes to a PHP file. GitHub Actions correctly detected file changes and added a comment. Then I removed the PHP changes by e1b5219. GitHub Actions updated the existing comment with a comment indicating that no PHP files were changed in the latest commit.