Sync from GitHub Pull Requests to WordPress Trac via Travis CI
This script facilitates contributing to WordPress Core via GitHub Pull Requests. See WordPress Trac #34694.
Caveat: This is intended for users in trusted contributor teams as it requires the user
to open open an internal (intra-repo) pull request from feature branch to
It will not work when opening a pull request from a fork due to Travis CI’s security restrictions
on environment variables. So any pull requests from external contributors will
need to be manually applied to a feature branch by a repo contributor and then
open an intra-repo pull request (while closing the original inter-repo pull request).
develop.git.wordpress.orgrepo onto GitHub and enable Travis CI for it. See instructions in Contributing to WordPress Core via GitHub.
Create a bot user on WordPress.org (e.g.
xwp-bot) and request that the
XML_RPCprivilege be granted for that user.
- Ensure the patch from Trac #34694 is applied to WordPress Core; if not already upstreamed, make it the first commit to each feature branch.
- Edit the Travis CI settings for your WordPress GitHub clone to add the following environment variables:
WPORG_USERNAME: Use the Trac bot user you created.
WPORG_PASSWORD: Use password for Trac bot user, and make sure added with “Display value in build log” off.
For more information, see Streamlining Contributions to WordPress Core via GitHub.
Once configured, a developer with write access to the GitHub repo can contribute to WordPress Core as follows:
- Ensure that a Trac ticket exists.
Push commits to a feature branch on GitHub named after the Trac ticket (e.g.
Open pull request to
master; this must be an internal (intra-repo) pull request, not from a fork (inter-repo).
- Watch Travis CI run its tests, and when completed look at Trac to see the patch uploaded.
As a bonus, the changes in the pull request will also have the following checks run:
- Modified PHP files will be checked for syntax errors.
PHP changes will be checked with PHP_CodeSniffer against the
JS changes will be checked with JSCS against the
Note that if there are no PHP files modified in a pull request, the PHPUnit tests will be skipped altogether, drastically speeding up the build time.
For the initial post that describes the approach, as linked above, see Streamlining Contributions to WordPress Core via GitHub.
For a prior post describing the manual workflow that is being streamlined here, also as linked above, see Contributing to WordPress Core via GitHub.
See also the WordPress Trac #34694: Facilitate automated testing in context of pull requests and diffs.