Merge pull request #3 from gautamkrishnar/patch-2

Updated code to do commit only if readme changed
This commit is contained in:
Athul Cyriac Ajay
2020-07-10 18:01:07 +05:30
committed by athul
2 changed files with 3 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ FROM python:latest
# Install dependencies.
ADD requirements.txt /requirements.txt
ADD main.py /main.py
RUN pip install -r requirements.txt
CMD python main.py

View File

@@ -53,5 +53,6 @@ if __name__ == '__main__':
stats = getStats()
rdmd = decodeReadme(contents.content)
newreadme = generatenewReadme(stats=stats, readme=rdmd)
if newreadme != rdmd:
repo.update_file(path=contents.path, message="Updated with Dev Metrics",
content=newreadme, sha=contents.sha, branch="master")