n0samu / gh-wiki-monitor

A Google Apps Script that sends notifications whenever someone edits a GitHub wiki.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gh-wiki-monitor

A Google Apps Script that sends notifications whenever someone edits a GitHub wiki. Can send notifications via email or Discord webhook. Requires the cheeriogs script library.

Setup

  1. Create a new Google Apps Script project
  2. Follow the instructions on the cheeriogs page to add Cheerio to your project
  3. Copy the code from my Code.gs file into your project and hit Ctrl-S to save
  4. Click the Project Settings tab on the left, scroll down and click "Add script property"
  5. Create a property called GITHUB_REPO. Its value should be the full name of the repository you want to monitor, such as n0samu/gh-wiki-monitor.
  6. If you want to receive email notifications, create a script property called EMAIL_ADDRESS and set it to your email address.
  7. If you want to receive notifications in a Discord channel, first follow the instructions in the "Making a Webhook" section of this article. (Ignore the "GitHub Webhook Integration" section - that only allows you to receive notifications for issues, PRs, etc - not wiki edits.) Copy the webhook URL, then create a script property called DISCORD_WEBHOOK and paste in the webhook URL.
  8. Save your script properties, then click the Triggers tab on the left.
  9. Click "Add a Trigger", then under "Choose which function to run" select "main".
  10. Use the "Time-driven" event source and choose how often you want the script to check for edits. I suggest setting the script to run every 10 minutes.

That's it! Now you can get notified whenever someone edits your wiki, instead of discovering some rando deleted your documentation a week after the fact! 😅

About

A Google Apps Script that sends notifications whenever someone edits a GitHub wiki.

License:MIT License


Languages

Language:JavaScript 100.0%