Skip to content

Commit

Permalink
Add CI script to check format
Browse files Browse the repository at this point in the history
  • Loading branch information
anishathalye committed Dec 2, 2022
1 parent 8da92e6 commit cd92223
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI
on:
push:
pull_request:
schedule:
- cron: '0 8 * * 6'
jobs:
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
- run: gem install rufo
- run: rufo -c .
12 changes: 6 additions & 6 deletions proof-html.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
require 'html-proofer'
require 'json'
require 'uri'
require "html-proofer"
require "json"
require "uri"

CHROME_FROZEN_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.0.0 Safari/537.36"

def get_bool(name, fallback)
s = ENV["INPUT_#{name}"]
return fallback if s.nil? or s == ''
return fallback if s.nil? or s == ""
case s
when /^t/i # matches "t", "true", "True"
true
Expand All @@ -21,7 +21,7 @@ def get_bool(name, fallback)

def get_int(name, fallback)
s = ENV["INPUT_#{name}"]
return fallback if s.nil? or s == ''
return fallback if s.nil? or s == ""
s.to_i
end

Expand Down Expand Up @@ -67,7 +67,7 @@ def get_str(name)
uri = URI.parse request.url
base = "#{uri.scheme}://#{uri.host}"
token = tokens[base]
request.options[:headers]['Authorization'] = "Bearer #{token}" unless token.nil?
request.options[:headers]["Authorization"] = "Bearer #{token}" unless token.nil?
end
proofer.run
rescue => msg
Expand Down

0 comments on commit cd92223

Please sign in to comment.