GitHubFlow PR merge idiot-proofing

Confirmation before common mistakes when merging Pull Requests in github

2016/04/21のページです。最新版はこちら

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         GitHubFlow PR merge idiot-proofing
// @namespace    https://gist.github.com/raveren/f08ba2673a92c582692e1a233621762f
// @version      0.3
// @author       raveren
// @description  Confirmation before common mistakes when merging Pull Requests in github
// @match        https://github.com/*/pull/*
// ==/UserScript==

(function() {
    document.querySelector('.js-merge-branch-action').addEventListener('click', function(e){
        if ( document.querySelector('#commits_tab_counter').innerHTML.trim()!='1'
            && !confirm('More than one commit, you still wanna merge?')) {
            e.preventDefault();
            e.stopPropagation();
            return false;
        }
        
        if ( document.querySelector('.text-pending') && !confirm('Build not complete yet, you still wanna merge?')) {
            e.preventDefault();
            e.stopPropagation();
            return false;
        }
    });
})();