Sends a message to a Discord channel at an interval with a running count of the number of GitHub stars a GitHub repository has.

See the Discord documentation for generating a webhook address here. Remember to store it as a secret environment variable (named here as DISCORD_WEBHOOK_URL) so that others cannot find your URL and post unwanted messages to your channel!

See the documentation on scheduling and https://crontab.guru/ to configure how often the updates are posted.

image.png

Extension ideas 💡

  • Record the difference in stars (using persistent storage to store data between runs)
  • Print the value of the open_issues_count field to track the number of issues on the GitHub repository
  • Look at the GitHub events API and for example print new and closed pull requests in the span of a week