Skip to content
Checks your GitHub Pages site for common DNS configuration issues
Ruby Shell
Branch: master
Clone or download

Latest commit

parkr Merge pull request #118 from github/dependabot/bundler/webmock-tw-3.8
Update webmock requirement from ~> 1.21 to ~> 3.8
Latest commit 79f0f3b Mar 13, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Fix fastly IP list Feb 26, 2020
lib Rewrite error initialization to avoid Ruby 2.7 warnings Feb 26, 2020
script Run a smoke test check May 16, 2018
spec
.gitignore dont monkey patch rspec Oct 29, 2016
.rspec
.rubocop.yml
.travis.yml
Gemfile
LICENSE.md bump copyright date Oct 23, 2017
README.md
github-pages-health-check.gemspec

README.md

GitHub Pages Health Check

Checks your GitHub Pages site for common DNS configuration issues

Build Status Gem Version

Installation

gem install github-pages-health-check

Usage

Basic Usage

> check = GitHubPages::HealthCheck::Site.new("choosealicense.com")
=> #<GitHubPages::HealthCheck::Site @domain="choosealicense.com" valid?=true>
> check.valid?
=> true

An invalid domain

> check = GitHubPages::HealthCheck::Site.new("foo.github.com")
> check.valid?
=> false
> check.valid!
raises GitHubPages::HealthCheck::Errors::InvalidCNAMEError

Retrieving specific checks

> check.domain.should_be_a_record?
=> true
> check.domain.a_record?
=> true

Getting checks in bulk

> check.to_hash
=> {
 :cloudflare_ip?=>false,
 :old_ip_address?=>false,
 :a_record?=>true,
 :cname_record?=>false,
 :valid_domain?=>true,
 :apex_domain?=>true,
 :should_be_a_record?=>true,
 :pointed_to_github_user_domain?=>false,
 :pointed_to_github_pages_ip?=>false,
 :pages_domain?=>false,
 :valid?=>true
}
> check.to_json
=> "{\"cloudflare_ip?\":false,\"old_ip_address?\":false,\"a_record?\":true,\"cname_record?\":false,\"valid_domain?\":true,\"apex_domain?\":true,\"should_be_a_record?\":true,\"pointed_to_github_user_domain?\":false,\"pointed_to_github_pages_ip?\":false,\"pages_domain?\":false,\"valid?\":true}"

Getting the reason a domain is invalid

> check = GitHubPages::HealthCheck::Site.new "developer.facebook.com"
> check.valid?
=> false
> check.reason
=> #<GitHubPages::HealthCheck::InvalidCNAME>
> check.reason.message
=> "CNAME does not point to GitHub Pages"

Repository checks

Repository checks require a personal access or OAuth token with repo or scope. This can be passed as the second argument to the Site or Repository constructors like so:

check = GitHubPages::HealthCheck::Site.new "github/pages-health-check", access_token: "1234

You can also set OCTOKIT_ACCESS_TOKEN as an environmental variable, or via a .env file in your working directory.

You can’t perform that action at this time.