Skip to content

Instantly share code, notes, and snippets.

@gustiando
Last active August 27, 2018 20:58
Show Gist options
  • Save gustiando/7c808f2092e85d3612f1 to your computer and use it in GitHub Desktop.
Save gustiando/7c808f2092e85d3612f1 to your computer and use it in GitHub Desktop.
[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