Skip to content

Commit

Permalink
fix: improve how we detect that the PR is managed by Mergify
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

Change-Id: I2f812d20513947f8ba78f25c7d8fc46a27bef227
  • Loading branch information
DouglasBlackwood committed Jan 15, 2025
1 parent 0870ab5 commit 34f7d76
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 34f7d76

Please sign in to comment.