vaakash / git-it-write

A WordPress plugin to publish markdown files present in a Github repository as posts to WordPress automatically.
https://www.aakashweb.com/wordpress-plugins/git-it-write/
GNU General Public License v3.0
49 stars 22 forks source link

Get GitHub info #34

Open tblobaum opened 1 year ago

tblobaum commented 1 year ago

Is there a way to retrieve the github credentials in php? I am working on a news aggregator theme and it requires git-it-write so it would be better if I could just retrieve the github credentials programmatically instead of asking the user to enter them into a separate settings page.

tblobaum commented 1 year ago

IMG_6491

vaakash commented 1 year ago

Hi @tblobaum,

AFAIK, the access token must be manually created by the user and that access token must be entered in the settings page. Please do check Github REST API and documentation to see if any shortcut is possible.

Previously Git it write did not accept any username and access token and later to support private repositories this feature was added. As I remember username and access token are not needed for public repositories. The open access has some restrictions too. But you can give it a try without any username and access token and see if it works for you. You need to comment the below line for now. https://plugins.trac.wordpress.org/browser/git-it-write/trunk/includes/repository.php#L35

Thanks, Aakash