Skip to content

Query in near-realtime if a user has starred a GitHub repository.

License

Notifications You must be signed in to change notification settings

coder/starquery

Repository files navigation

starquery

"Join us on Discord"

Query in near-realtime if a user has starred a GitHub repository.

https://starquery.coder.com/coder/coder/user/kylecarbs
  • Uses GitHub Webhooks for near-realtime accuracy.
  • Periodically refreshes all stargazers using GitHub's GraphQL API for accuracy.
  • Start tracking a repository by adding it to the list!

This service is used by coder/coder to prompt users to star the repository if they haven't already!

Deployment

starquery is hosted at starquery.coder.com. Not all repositories are tracked by default (that'd be a lot to handle!). Feel free to repositories here.

To run starquery, GITHUB_TOKEN and REDIS_URL are required. WEBHOOK_SECRET must be set if accepting Webhooks from GitHub's API.

Hosted

The ./deploy.sh script can be used to update the service (probably should be automated at some point).

/run/starquery/environ must exist. Here is a template:

REDIS_URL=127.0.0.1:6379
BIND_ADDRESS=127.0.0.1:8080
# use cdrci account
GITHUB_TOKEN=
WEBHOOK_SECRET=

To set up the Cloudflare Tunnel, see the config file. cloudflared is ran in screen -S cloudflared:

cloudflared tunnel run 7e5e3b0d-4eb3-4aff-9924-e5f6efebcc2d

To set up a GitHub webhook:

  1. Head to the "New Webhook" page (e.g. https://github.com/coder/starquery/settings/hooks/new).
  2. Set the payload URL to https://starquery.coder.com/webhook.
  3. Click "Let me select individual events.", uncheck "Push", check "Stars".

Delivery should succeed for the initial ping!

About

Query in near-realtime if a user has starred a GitHub repository.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks