Skip to content

Instantly share code, notes, and snippets.

@haridsv
Last active June 12, 2024 15:14
Show Gist options
  • Save haridsv/a65dea61e81ae47a268d1b4ea61b2fec to your computer and use it in GitHub Desktop.
Save haridsv/a65dea61e81ae47a268d1b4ea61b2fec to your computer and use it in GitHub Desktop.
Approve the PR with an LGTM comment.
document.getElementById("files_tab_counter").click();
setTimeout(function approvePR() {
var ele = document.querySelector(".js-review-changes");
if (! ele) {
setTimeout(approvePR, 300);
return;
}
ele.click();
document.getElementById("pull_request_review_body").value = "LGTM";
document.evaluate("//*/form/div[1]/fieldset/div/div[2]/span/label", document.querySelector("#review-changes-modal > div"), null, XPathResult.ANY_TYPE, null).iterateNext().click();
document.evaluate("//*/form/div[2]/button//*[contains(text(), 'Submit review')]", document.querySelector("#review-changes-modal > div"), null, XPathResult.ANY_TYPE, null).iterateNext().click()
}, 300);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment