fix: undo changes to patch (#26983)

* fix: undo changes to patch

* ci: ignore empty body / head

(cherry picked from commit 8bbec42fa0)

# Conflicts:
#	.github/helper/documentation.py
This commit is contained in:
Ankush Menat
2021-08-17 15:14:13 +05:30
committed by Mergify
parent f5160dc83d
commit e62005ae55
2 changed files with 26 additions and 4 deletions

View File

@@ -68,6 +68,32 @@ def check_pull_request(number: str) -> "tuple[int, str]":
if __name__ == "__main__":
<<<<<<< HEAD
exit_code, message = check_pull_request(sys.argv[1])
print(message)
sys.exit(exit_code)
=======
pr = sys.argv[1]
response = requests.get("https://api.github.com/repos/frappe/erpnext/pulls/{}".format(pr))
if response.ok:
payload = response.json()
title = (payload.get("title") or "").lower().strip()
head_sha = (payload.get("head") or {}).get("sha")
body = (payload.get("body") or "").lower()
if (title.startswith("feat")
and head_sha
and "no-docs" not in body
and "backport" not in body
):
if docs_link_exists(body):
print("Documentation Link Found. You're Awesome! 🎉")
else:
print("Documentation Link Not Found! ⚠️")
sys.exit(1)
else:
print("Skipping documentation checks... 🏃")
>>>>>>> 8bbec42fa0 (fix: undo changes to patch (#26983))