Skip to content

Commit 0dbdc4b

Browse files
authored
Removed PRs from summaries (#14)
From the documentation: > GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from "Issues" endpoints will be an issue id. This commit filters objects that *have* a `pull_request` object
1 parent cd47eb3 commit 0dbdc4b

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ outputs:
3838

3939
runs:
4040
using: 'docker'
41-
image: 'docker://ghcr.io/paritytech/stale-issues-finder/action:0.0.5'
41+
image: 'docker://ghcr.io/paritytech/stale-issues-finder/action:0.0.6'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stale-issues-finder",
3-
"version": "0.0.5",
3+
"version": "0.0.6",
44
"description": "Find what issues have been stale for a given time",
55
"main": "src/index.ts",
66
"engines": {

src/github/issuesParser.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ const getAllIssues = async (octokit: InstanceType<typeof GitHub>, repo: Repo): P
1111
const perPage = 100;
1212
let currentPage = 1;
1313
const { data } = await listForRepo(octokit, repo, perPage, currentPage);
14-
let issues = data;
14+
15+
// GitHub's REST API v3 considers every pull request an issue so we need to get objects without the PR key
16+
let issues = data.filter(data => !data.pull_request);
1517
let fullPage = issues.length > 99;
1618
while (fullPage) {
1719
currentPage++;

0 commit comments

Comments
 (0)