【问题标题】:Github - remove issues entered in errorGithub - 删除错误输入的问题
【发布时间】:2013-05-07 19:32:48
【问题描述】:

我在 github 上的项目中已经输入了数十个问题,这些问题在那里没有位置。一些爱因斯坦运行了一个脚本,并通过 api 创建了所有这些无意义的问题。与这些问题无关。

当然有办法可以删除它们,但我似乎无法在文档中找到它。

【问题讨论】:

  • 有什么理由不想关闭它们?
  • 我猜他想删除它们,这样他就可以重新输入它们,以便将它们链接起来。据我所知,您所能做的就是关闭问题。我找不到真正删除它们的方法。
  • 我可以这样做,但它会说我有 200 个已关闭的问题,而实际上只有 100 个,而且看起来所有荒谬的标题都是一场灾难......
  • removing github issues 的可能重复项

标签: github github-api


【解决方案1】:

没有办法真正删除问题。您可以做的是创建一个新标签,以表明这是一次垃圾邮件攻击。然后,您可以使用edit 的 API 来关闭每个要关闭的问题并使用SPAM 标签进行标记。看到它的人会看到问题旁边显示的标签,这确实是您所希望的最好的。

如果您更熟悉某种特定语言,请检查其中写有 library 以使您的生活更轻松。

【讨论】:

  • 这就是我的想法/恐惧。谢谢大家。
  • 您也可以block the user 阻止他/她打开您的存储库中的任何其他问题。
【解决方案2】:

自 2018 年 11 月和this tweet...您现在可以删除问题(如果您是 GitHub 项目的管理员/所有者)

推文如下:

你一直在要求它。

您知道问题所在。

删除它们。 ?

警告:目前没有“撤消”。

这是in public betadocumentation is "Deleting an issue"

当您删除问题时,协作者不会收到通知。如果您访问已删除问题的 URL,您会看到一条消息,指出该问题已被删除。

默认情况下,您只能删除您的用户帐户拥有的存储库中的问题。作为个人用户帐户拥有的存储库中的协作者,您无法删除问题。

【讨论】:

    【解决方案3】:

    由于法律问题,我不得不删除一个项目的许多 cmets 的几个问题。我做了如下:

    1. 删除所有 cmets
    2. 编辑问题的文本(“此问题已被删除并屏蔽”)
    3. 阻止问题

    复制粘贴到浏览器地址栏:

    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) })()
    

    扩展:

    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)
    })()

    【讨论】:

    • 第 3 项是做什么的?
    • @Gaia 我编辑了答案。该代码是自动执行上述步骤的“快捷方式”。不知道还能不能用(要看GitHub有没有改过类名)。
    • 示例:使用此方法发出“已删除”问题:github.com/aabilio/PyDownTV2/issues/135
    猜你喜欢
    • 1970-01-01
    • 2019-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-04
    • 2021-01-24
    • 2018-03-10
    相关资源
    最近更新 更多