Created
February 11, 2020 22:35
-
-
Save electricg/9ad679c5ff40cb2d3365af54d9020ec5 to your computer and use it in GitHub Desktop.
Extension to detect the type of merge based on the base branch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const options = { | |
master: 'merge', | |
staging: 'squash' | |
}; | |
const base = document.querySelector('#partial-discussion-header .base-ref').textContent.trim(); | |
const what = options[base]; | |
[...document.querySelectorAll('button[data-details-container=".js-merge-pr"]')].forEach(item => { | |
item.disabled = true; | |
}); | |
document.querySelector(`.select-menu-merge-method button[value="${what}"]`).click(); | |
document.querySelector(`button[data-details-container=".js-merge-pr"][class*="${what}"]`).disabled = false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment