The SIMPLEST-EVER "This-Repo-Has-X-Stars" implemented via GitHub Actions. The original idea comes from this repo.
- Fork this repo;
- Generate a personal access tokens with "public_repo" scope, and copy it;
- Set the token as a secret named "ADMIN_TOKEN" in the "Settings -> Secret" tab of your forked repo;
- Star your own repo, check "StarWatcher" workflow runs, and refresh the repo page in a minute.
Don't worry about your token being used for malicious purposes. .github/workflows/star_watcher.yml
describes how your generated token is used and it is only be used to update a repository.
There are several awesome implementations via different approaches. Try them! ❤️
- Polling (original): This-Repo-Has-X-Stars;
- WebHooks (AWS Lambda): This-Repo-Has-X-Stars;
- GitHub Actions (nodejs): This-repo-has-x-stars-y-forks-action;
- GitHub Actions (curl, ours): This-Repo-Has-X-Stars.
Sadly, an unstar
operation won't trigger a watch
event for GitHub Actions. That is to say, the X cannot decrease. LOL, is it a blessing in disguise?