Closed BogdanUngureanu closed 7 months ago
- Pass a new optional GitHub access token as a flag on the command.
I'd use an environment variable instead, e.g. getenv( 'GITHUB_TOKEN' )
Hey @swissspidy, that's a great idea! I've updated the PR to contain the environment variable you proposed. Thanks!
Closing in favor of #421
Related to https://github.com/wp-cli/extension-command/issues/91
This PR adds support for installing plugins and themes from GitHub using the
release/latest
URLs.In order to get the latest release assets, I'm proposing to use the GitHub public API to extract the latest version of the plugin/theme from GH releases. If there's no asset defined, we will fall back to the source code zip file.
While the implementation works right now, I haven't added support for GitHub's API request limits. Currently, after 60 requests per hour, the user is required to use an access token in order to make an API request. However, this PR doesn't expose a way to pass that token to the request.UPDATE: I've introduced a new environment variable called _GITHUBTOKEN.