Created
April 30, 2020 12:03
-
-
Save splintor/4d6b7500c6e2667c8daa731af92c4ae5 to your computer and use it in GitHub Desktop.
Github - Format pull request message
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
| // ==UserScript== | |
| // @name Github - Format pull request message | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Set default value for new PR description | |
| // @author Shmulik Flint | |
| // @match https://github.com/wix-private/*/compare/* | |
| // @grant none | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| const text = document.getElementById('pull_request_body'); | |
| if (!text) { | |
| return; | |
| } | |
| let prefix = "## Motivation"; | |
| const repoLink = document.querySelector('[data-pjax="#js-repo-pjax-container"]'); | |
| if (repoLink && repoLink.text == 'wixos') { | |
| prefix += ' (consider adding *ping* label)'; | |
| } | |
| if (!text.value.startsWith('#')) { | |
| text.value = `${prefix}\n${text.value}`; | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment