possible to embed Github list of issues (with specific tag) on website?

后端 未结 2 1244
盖世英雄少女心
盖世英雄少女心 2021-02-06 04:34

Does anyone know of an easy way to embed the list of issues with a specific tag from github onto a website?

This is to embed a list of open bugs on a project website.

相关标签:
2条回答
  • 2021-02-06 04:59

    Solution using jQuery:

    There is a way to this easily using the github api using just javascript (no need to set up github account, registering api tokens, etc..)

    Below is a small demo using jquery to get a list of all the open bugs for a github project (jquery in this example)

    var urlToGetAllOpenBugs = "https://api.github.com/repos/jquery/jquery/issues?state=open&labels=bug";
    
    $(document).ready(function () {
    $.getJSON(urlToGetAllOpenBugs, function (allIssues) {
        $("div").append("found " + allIssues.length + " issues</br>");
        $.each(allIssues, function (i, issue) {
            $("div")
                .append("<b>" + issue.number + " - " + issue.title + "</b></br>")
                .append(issue.body + "</br></br></br>");
        });
    });
    });
    

    jsfiddle: http://jsfiddle.net/bso6xLee/2/

    0 讨论(0)
  • 2021-02-06 05:12

    You would need to make a query (as in "Embedding Github's bug tracker within a website for the users to report directly from within the website").
    Then you would generate the html section of your website page which would display the result of that query.

    That would use the GitHub API on Issues

    GET /user/issues
    

    Use your account, or an account which sees only the repo(s) you want to list the issues from.

    And you can specify the labels

    labels string: A list of comma separated label names. Example: bug,ui,@high

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