mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-28 03:28:35 +08:00
feat: GitHub Repo Issues: add optional state and labels p... (#3766)
This commit is contained in:
@@ -27,7 +27,7 @@ GitHub provides some official RSS feeds:
|
||||
|
||||
### Repo Issues
|
||||
|
||||
<RouteEn author="HenryQW" path="/github/issue/:user/:repo" example="/github/issue/DIYgod/RSSHub" :paramsDesc="['GitHub username', 'GitHub repo name']" radar="1" />
|
||||
<RouteEn author="HenryQW" path="/github/issue/:user/:repo/:state?/:labels?" example="/github/issue/DIYgod/RSSHub/all/bug" :paramsDesc="['GitHub username', 'GitHub repo name', 'the state of the issues. Can be either `open`, `closed`, or `all`. Default: `open`.', 'a list of comma separated label names']" radar="1" />
|
||||
|
||||
### Repo Pull Requests
|
||||
|
||||
@@ -189,7 +189,7 @@ Website: https://news.ycombinator.com/
|
||||
|
||||
### issues
|
||||
|
||||
<Route author="hellodword" example="/project-zero-issues" path="/project-zero-issues">
|
||||
<Route author="hellodword" example="/project-zero-issues" path="/project-zero-issues" />
|
||||
|
||||
## Visual Studio Code Marketplace
|
||||
|
||||
|
||||
+1
-1
@@ -260,7 +260,7 @@ router.get('/readhub/category/:category', require('./routes/readhub/category'));
|
||||
// GitHub
|
||||
router.get('/github/repos/:user', require('./routes/github/repos'));
|
||||
router.get('/github/trending/:since/:language?', require('./routes/github/trending'));
|
||||
router.get('/github/issue/:user/:repo', require('./routes/github/issue'));
|
||||
router.get('/github/issue/:user/:repo/:state?/:labels?', require('./routes/github/issue'));
|
||||
router.get('/github/pull/:user/:repo', require('./routes/github/pulls'));
|
||||
router.get('/github/user/followers/:user', require('./routes/github/follower'));
|
||||
router.get('/github/stars/:user/:repo', require('./routes/github/star'));
|
||||
|
||||
@@ -7,6 +7,8 @@ const md = require('markdown-it')({
|
||||
module.exports = async (ctx) => {
|
||||
const user = ctx.params.user;
|
||||
const repo = ctx.params.repo;
|
||||
const state = ctx.params.state;
|
||||
const labels = ctx.params.labels;
|
||||
|
||||
const host = `https://github.com/${user}/${repo}/issues`;
|
||||
const url = `https://api.github.com/repos/${user}/${repo}/issues`;
|
||||
@@ -15,6 +17,8 @@ module.exports = async (ctx) => {
|
||||
method: 'get',
|
||||
url,
|
||||
params: {
|
||||
state: state,
|
||||
labels: labels,
|
||||
sort: 'created',
|
||||
access_token: config.github && config.github.access_token,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user