Skip to content

Instantly share code, notes, and snippets.

@gumatias

gumatias/hub.sh

Last active Aug 27, 2018
Embed
What would you like to do?
[VTS GitHub PR Template] Generates PR Template #Template #GitHub
PR_JIRA_ISSUE=`g s | cut -d '/' -f 2`
BRANCH_DESCRIPTION=`g s | cut -d '/' -f 3`
PR_TITLE="${BRANCH_DESCRIPTION//-/ }"
g pull-request -r "viewthespace/convertibles" -l "qa" -m "[$PR_JIRA_ISSUE] $PR_TITLE This PR will... @viewthespace/convertibles" -e
javascript:(function() {
const prTitle = document.querySelector('#pull_request_title');
const branchName = document.querySelector(".branch span[title^='compare:']").innerHTML;
prTitle.value = '[' + branchName.split('/')[1].toUpperCase().replace(' ', '-') + '] ' + branchName.split('/')[2].replace(new RegExp('-', 'g'), ' ');
const prBody = document.getElementById('pull_request_body'); prBody.value += 'This PR will... \n\ncc @viewthespace/convertibles';
document.querySelector('.discussion-sidebar-heading').click();
setTimeout(function () {
Array.prototype.slice.call(document.querySelectorAll('.js-username')).filter(function (el) {
return el.innerText === 'viewthespace/convertibles';
})[0].click();
document.querySelector('.discussion-sidebar-heading').click();
}, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment