Merge pull request #3 from gautamkrishnar/patch-2
Updated code to do commit only if readme changed
This commit is contained in:
@@ -2,6 +2,7 @@ FROM python:latest
|
|||||||
|
|
||||||
# Install dependencies.
|
# Install dependencies.
|
||||||
ADD requirements.txt /requirements.txt
|
ADD requirements.txt /requirements.txt
|
||||||
|
ADD main.py /main.py
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
CMD python main.py
|
CMD python main.py
|
||||||
1
main.py
1
main.py
@@ -53,5 +53,6 @@ if __name__ == '__main__':
|
|||||||
stats = getStats()
|
stats = getStats()
|
||||||
rdmd = decodeReadme(contents.content)
|
rdmd = decodeReadme(contents.content)
|
||||||
newreadme = generatenewReadme(stats=stats, readme=rdmd)
|
newreadme = generatenewReadme(stats=stats, readme=rdmd)
|
||||||
|
if newreadme != rdmd:
|
||||||
repo.update_file(path=contents.path, message="Updated with Dev Metrics",
|
repo.update_file(path=contents.path, message="Updated with Dev Metrics",
|
||||||
content=newreadme, sha=contents.sha, branch="master")
|
content=newreadme, sha=contents.sha, branch="master")
|
||||||
|
|||||||
Reference in New Issue
Block a user