Github - remove issues entered in error

后端 未结 3 794
忘了有多久
忘了有多久 2020-12-30 03:04

Dozens of issues have been entered into my project on github that have no place there. Some Einstein ran a script and created all these nonsensical issues through the api.

相关标签:
3条回答
  • 2020-12-30 03:45

    There is no way to actually delete the issues. What you can do, to indicate that this was a spam attack, is create a new label. You can then use the API to edit each issue to be closed and labeled with the SPAM label. Those who look at it will see the label displayed along side the issue and it's really the best you can hope for.

    If you're more comfortable with a specific language, check for a library written in it to make your life easier too.

    0 讨论(0)
  • Since Nov. 2018 and this tweet... you now can delete issues (if you are an Administrator/owner of a GitHub project)

    The tweet read:

    You've been asking for it.

    You know the issue(s).

    Delete 'em.

    0 讨论(0)
  • 2020-12-30 04:00

    Due to legal problems I've had to delete several issues with many comments of a project. I did as follows:

    1. Deleting all comments
    2. Editing the text of the issue ("THIS ISSUE WAS DELETED AND BLOCKED")
    3. Blocking the issue

    Copy paste on browser address bar:

    javascript:(function(){ $('.delete-button.octicon.octicon-x.js-comment-delete').each(function(){ href=$(this).attr("href"); if(href!==undefined) { console.log("DELETING: "+href); $.ajax({type:"DELETE",url:href}); } }); firstCommentToedit=$('form.js-comment-update')[0]; $.ajax({ type:"POST", url:firstCommentToedit.action, data:{ _method:$(firstCommentToedit).find('input[name=_method]').val(), "issue[body]":"THIS ISSUE WAS DELETED AND BLOCKED", authenticity_token:$(firstCommentToedit).find('input[name=authenticity_token]').val() } }); lockLink=$('a[href$="/lock"]')[0]; if (lockLink!==undefined) { $.ajax({ type:"POST", url:lockLink.href, data:{_method:$(lockLink).attr("data-method")} }); } setTimeout(function(){window.location=window.location;},3000) })()
    

    Expanded:

    javascript: (function() {
        $('.delete-button.octicon.octicon-x.js-comment-delete').each(function() {
            href = $(this).attr("href");
            if (href !== undefined) {
                console.log("DELETING: " + href);
                $.ajax({
                    type: "DELETE",
                    url: href
                });
            }
        });
        firstCommentToedit = $('form.js-comment-update')[0];
        $.ajax({
            type: "POST",
            url: firstCommentToedit.action,
            data: {
                _method: $(firstCommentToedit).find('input[name=_method]').val(),
                "issue[body]": "THIS ISSUE WAS DELETED AND BLOCKED",
                authenticity_token: $(firstCommentToedit).find('input[name=authenticity_token]').val()
            }
        });
        lockLink = $('a[href$="/lock"]')[0];
        if (lockLink !== undefined) {
            $.ajax({
                type: "POST",
                url: lockLink.href,
                data: {
                    _method: $(lockLink).attr("data-method")
                }
            });
        }
        setTimeout(function() {
            window.location = window.location;
        }, 3000)
    })()

    0 讨论(0)
提交回复
热议问题