From 78068da4756a4c34bc0e45fdbd75c43aba101045 Mon Sep 17 00:00:00 2001 From: TehPeGaSuS <25697531+TehPeGaSuS@users.noreply.github.com> Date: Thu, 7 May 2026 20:26:57 +0200 Subject: [PATCH] feat(route): make GitHub pulls title and docs consistent with issues (#21903) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(route): make GitHub pulls title and docs consistent with issues I'm not really a coder, but I use RSSHub to bridge GitHub updates into IRC for my community. I noticed that the `pulls.ts` route didn't show the "Open/Closed" state in the feed title like the `issues.ts` route does, which was making my users a bit confused! I tried my best to replicate the logic and metadata structure from `issues.ts` over to `pulls.ts`. Changes: - Updated the feed title to dynamically show the state (Open/Closed/All) and any labels. - Updated the parameter metadata so the documentation looks as clean and organized as the Issues page. I've tested this locally and it’s working perfectly for my IRC tracker. Hopefully, this helps keep things consistent across the GitHub routes! Closes #21902 * Fix title formatting in pull request response --- lib/routes/github/pulls.ts | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/routes/github/pulls.ts b/lib/routes/github/pulls.ts index 1d0c87698..7dcf7550f 100644 --- a/lib/routes/github/pulls.ts +++ b/lib/routes/github/pulls.ts @@ -14,7 +14,29 @@ export const route: Route = { path: '/pull/:user/:repo/:state?/:labels?', categories: ['programming'], example: '/github/pull/DIYgod/RSSHub', - parameters: { user: 'User name', repo: 'Repo name', state: 'the state of pull requests. Can be either `open`, `closed`, or `all`. Default: `open`.', labels: 'a list of comma separated label names' }, + parameters: { + user: 'GitHub username', + repo: 'GitHub repo name', + state: { + description: 'the state of pull requests.', + default: 'open', + options: [ + { + label: 'Open', + value: 'open', + }, + { + label: 'Closed', + value: 'closed', + }, + { + label: 'All', + value: 'all', + }, + ], + }, + labels: 'a list of comma separated label names', + }, features: { requireConfig: false, requirePuppeteer: false, @@ -61,7 +83,7 @@ async function handler(ctx) { return { allowEmpty: true, - title: `${user}/${repo} Pull requests`, + title: `${user}/${repo} ${state.replace(/^\S/, (s) => s.toUpperCase())} Pull Requests${labels ? ' - ' + labels : ''}`, link: host, item: data.map((item) => ({ title: item.title,