Git Product home page Git Product logo

tech-docs-monitor's Introduction

Tech Docs Template - page expiry notifier

This repo is part of the tech-docs-template, and is used in conjunction with the page expiry feature that is part of the tech-docs-gem

GitHub Actions will run the script once a day during weekdays. It will look at the pages API for your site, find all pages that have expired, and post a Slack message to the owner of each page to let them know that it needs reviewing.

Usage

alphagov users

If you are part of the alphagov GitHub organisation you can enable the notifier by raising a PR to add your published documentation to the Rakefile:

pages_urls = [
  "https://gds-way.cloudapps.digital/api/pages.json",
  "https://docs.publishing.service.gov.uk/api/pages.json",
  "your-docs-site.cloudapps.digital"
]

If you want to limit the number of links that are posted to Slack after a single run, add this to limits in the Rakefile

limits = {
  "your-docs-site.cloudapps.digital" => 3
}

The default behaviour is no limit, and the Slack message will contain all pages discovered.

General configuration

The following environment variables are necessary:

  • SLACK_WEBHOOK_URL: The Slack webhook URL to allow messages to be posted.
  • REALLY_POST_TO_SLACK: Messages will only be posted to Slack if the value of this var is 1.

Slack message customisation

This is the default Slack message when pages expire:

default-message-example

You can customise parts of the Slack message by configuring environment variables. The environment variables you can customise are:

Environment variable name Purpose Default value
OVERRIDE_SLACK_MESSAGE_PREFIX Sets a custom message prefix. "Hello 🐾, this is your friendly manual spaniel."
OVERRIDE_SLACK_CHANNEL Sets a single Slack channel to which all messages will be sent. The owning Slack channel for each page reported in the site's /api/pages.json endpoint
OVERRIDE_SLACK_USERNAME Sets the username to which Slack messages are attributed. "Daniel the Manual Spaniel"
OVERRIDE_SLACK_ICON_EMOJI Sets the icon emoji attributed to Slack messages. ":daniel-the-manual-spaniel:"

This is an example of a customised Slack message:

customised-message-example

Licence

The gem is available as open source under the terms of the MIT License.

tech-docs-monitor's People

Contributors

chrisbashton avatar dependabot[bot] avatar eddgrant avatar huwd avatar issyl0 avatar jhjava avatar lfdebrux avatar m-green avatar matmoore avatar mrwilson avatar nathand-gds avatar philandstuff avatar robinmitra avatar sihugh avatar smford avatar thomasleese avatar tijmenb avatar timblair avatar tobysaundersgds avatar vixus0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tech-docs-monitor's Issues

Would it be possible to provide a distributable RubyGem?

Hi folks,

We're using the tech-docs-monitor over at HMRC, where we've built it in to an AWS Lambda function. This is working really well for us, however it currently requires us to maintain a fork of this repository in order to add the necessary Lambda build and runtime functionality.

It occurred to me that, if there were a distributable tech-docs-monitor RubyGem then we could ditch our fork and simply consume the Gem in the usual manner, adding the necessary scaffolding to allow us to build the Gem in to an AWS Lambda. I was wondering if you might be open to such an approach?

Grateful for your thoughts on this one. In case it aids your thinking then you can see the adaptations that we've made to get everything work in AWS Lambda here.

Many thanks,

Edd

Question around using different Slack channels per-page

Hey folks,

From reading the Slack Webhooks documentation it seems that Slack webhooks are only able to post to a single pre-configured Slack channel. I notice that the configuration here only configures a single Slack URL environment variable, yet different pages might have different OWNER_SLACK frontmatter variables. Does this mean that in practice only a single Slack channel can be used for all notifications?

Many thanks,

Edd

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.