Skip to content

Commit

Permalink
fix: don't fail to retrieve branch protection if branch is gone
Browse files Browse the repository at this point in the history
Fixes MERGIFY-ENGINE-255
  • Loading branch information
sileht committed Apr 1, 2021
1 parent c26fdfc commit 2298ee0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mergify_engine/actions/merge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ async def _get_queue_summary(
async def _get_branch_protection_conditions(
ctxt: context.Context,
) -> typing.List[filter.Filter]:
branch = await ctxt.repository.get_branch(ctxt.pull["base"]["ref"])
try:
branch = await ctxt.repository.get_branch(ctxt.pull["base"]["ref"])
except http.HTTPNotFound:
return []
if not branch["protection"]["enabled"]:
return []
return [
Expand Down

0 comments on commit 2298ee0

Please sign in to comment.