Skip to content

Commit

Permalink
fix: dont try to merge when automerge is already enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Jan 21, 2023
1 parent 7b280b8 commit c276981
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/events/pr-handlers/actions/enableGithubAutoMerge.ts
Expand Up @@ -21,6 +21,9 @@ export const enableGithubAutoMerge = async <
login?: string,
): Promise<AutoMergeRequest | null> => {
if (pullRequest.merged_at) return null;
if (pullRequest.auto_merge) {
return { enabledBy: pullRequest.auto_merge.enabled_by };
}

if (
!('mergeable_state' in pullRequest) ||
Expand Down

0 comments on commit c276981

Please sign in to comment.