forked from github/government.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
23 lines (21 loc) · 691 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true
require 'html-proofer'
task :test do
sh 'bundle exec jekyll build'
proofer = HTMLProofer.check_directory(
'./_site/',
check_html: true,
check_external_hash: false,
hydra: { max_concurrency: 10 },
url_ignore: [%r{https://developer.github.com}, %r{https://docs.github.com}, %r{https://help.github.com}],
ignore_files: [%r{/community/}, %r{/stories/}],
ignore_status_codes: [429]
)
token = ENV.fetch('GITHUB_TOKEN', nil)
unless token.nil?
proofer.before_request do |request|
request.options[:headers]['Authorization'] = "Bearer #{token}" if request.base_url == 'https://github.com'
end
end
proofer.run
end