YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.
MIT License
2.22k stars 403 forks source link

Access token in Github #475

Closed Alexlytle closed 2 years ago

Alexlytle commented 2 years ago

I can push a public repo without any issues :) but when I try a private repo it doesn't work. I create a personal access token in GitHub get access to everything and it doen't work. Is it not personal access tokens and is it another sort of token to get this to work?

Alexlytle commented 2 years ago

I guess my question what kind of token is this package looking for?

YahnisElsts commented 2 years ago

It was a personal access token the last time I tested it, which, admittedly, was a few months ago. I'm talking about the tokens that you can create in "Settings -> Developer settings -> Personal access tokens".

This may sound obvious, but please double-check that you're passing the correct token (and the whole token) to setAuthentication().

I would also recommend installing the Debug Bar plugin. The update checker integrates with Debug Bar to provide additional debugging information. In the debug bar, open the "PUC (your-slug)" section and try clicking the "Check Now" button. If there are any GitHub API errors, the update checker should show them there.

Alexlytle commented 2 years ago

I did exactly that with no luck. I didn't get any errors with the debug bar. I guess i will try GitLab or use GitHub and toggle private to public on the repo settings. I really do appreciate this package thanks for your work :) image

image

YahnisElsts commented 2 years ago

All right. I'll close the issue for now, but if you want to investigate this problem further at some point, feel free to reopen it or create a new one.

Alexlytle commented 2 years ago

Im sorry its working i didnt realize you have to personal access token inside the theme your updating. I only had the personal access token inside in my development theme

YahnisElsts commented 2 years ago

Ah, yes. The update checker needs access to the repository to detect updates, and if the repository is private, it can't do that without the token.

Alexlytle commented 2 years ago

Thank you so much for your help !