Last active
May 11, 2021 17:45
-
-
Save kpittman-securus/580ee7160205cac52ed78ab5723c92ea to your computer and use it in GitHub Desktop.
With Jenkins/GitHub integration, open all failed PRs in Jenkins (from the GitHub pull requests page)
This file contains hidden or 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
let pipe = (...funcs) => (...args) => funcs.reduce((prev, cur) => cur(prev), ...args); | |
let getAllPrs = () => Array.from(document.querySelectorAll('div[id^=issue]')); | |
let getPrNumber = (el) => el.querySelector('input[type=checkbox]').value; | |
let getFailedPrs = () => getAllPrs().filter((el) => el.querySelector('a.color-text-danger')); | |
let makeJenkinsUrl = (pr) => | |
`https://jenkins-example.com/job/PR-${pr}/lastBuild/`; | |
let open = (url) => window.open(url); | |
let openPr = pipe(getPrNumber, makeJenkinsUrl, open); | |
let openFailedPrs = () => getFailedPrs().map(openPr); | |
openFailedPrs(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment