fix: adds check to find placeholder in old readme

This commit is contained in:
Jovial Joe Jayarson 2023-02-27 12:33:59 +05:30
parent ac0bb21462
commit 29dba6dd79

View File

@ -375,6 +375,12 @@ def churn(old_readme: str, /) -> str | None:
Composes WakaTime stats within markdown code snippet 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 # getting content
if not (waka_stats := fetch_stats()): if not (waka_stats := fetch_stats()):
logger.error('Unable to fetch data, please rerun workflow\n') logger.error('Unable to fetch data, please rerun workflow\n')