Prevent unhandled exception when running via schedule (#69)

* Prevent unhandled exception when running via schedule
This commit is contained in:
Max Anderson
2021-04-18 18:53:12 -07:00
committed by GitHub
parent 2d5c80f215
commit e2a437cdbd

View File

@@ -394,7 +394,7 @@ def main():
if not from_branch:
print("PULL_REQUEST_FROM_BRANCH is not set, checking branch in payload.")
with open(check_events_json(), "r") as fd:
from_branch = json.loads(fd.read()).get("ref")
from_branch = json.loads(fd.read()).get("ref", "")
from_branch = from_branch.replace("refs/heads/", "").strip("/")
else:
print("PULL_REQUEST_FROM_BRANCH is set.")