Skip to content

Commit

Permalink
fix: improve how we detect that the PR is managed by Mergify (#36)
Browse files Browse the repository at this point in the history
The former implementation can detect any Mergify App icon in the page, even if the PR has been referenced by another one. We have to look for the "Summary" or the "Merge Protections" check-run.

Fixes MRGFY-4553
  • Loading branch information
DouglasBlackwood authored Jan 16, 2025
1 parent 0870ab5 commit f82718d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mergify.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ function tryInject() {
}

const appIconUrl = "https://avatars.githubusercontent.com/in/10562"
var isMergifyEnabledOnTheRepo = document.querySelector(`img[src^="${appIconUrl}?"]`)
var isMergifyEnabledOnTheRepo = document.querySelector(`img[src^="${appIconUrl}?"][alt="Summary"], img[src^="${appIconUrl}?"][alt="Mergify Merge Protections"]`)
if (!isMergifyEnabledOnTheRepo) {
return
}
Expand Down

0 comments on commit f82718d

Please sign in to comment.