Skip to content

Commit

Permalink
Merge branch 'Jcpetrucci-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jayfk committed Jul 25, 2016
2 parents 329460e + 52ae89f commit 2114eb2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions statuspage/statuspage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
from __future__ import absolute_import, print_function

import sys, os
import hashlib
import base64
from datetime import datetime, timedelta

from github import Github, UnknownObjectException
Expand Down Expand Up @@ -148,6 +150,14 @@ def run_update(name, token, org):
ref=sha,
)

remote_content = base64.b64decode(index.content)
remote_checksum = hashlib.sha1(remote_content.encode())
local_checksum = hashlib.sha1(content.encode())

if remote_checksum.hexdigest() == local_checksum.hexdigest():
click.echo("Local status matches remote status, no need to commit.")
return False

repo.update_file(
path="/index.html",
sha=index.sha,
Expand Down

0 comments on commit 2114eb2

Please sign in to comment.