Merge pull request #119 from joe733/workshop

fix: adds check to find placeholder in old readme
This commit is contained in:
Jovial Joe Jayarson
2023-02-28 12:36:09 +05:30
committed by GitHub

View File

@@ -375,6 +375,12 @@ def churn(old_readme: str, /) -> str | None:
Composes WakaTime stats within markdown code snippet
"""
# check if placeholder pattern exists in readme
if not re.findall(wk_i.waka_block_pattern, old_readme):
logger.warning(
f'Can\'t find `{wk_i.waka_block_pattern}` pattern in readme'
)
return None
# getting content
if not (waka_stats := fetch_stats()):
logger.error('Unable to fetch data, please rerun workflow\n')