Skip to content

Commit

Permalink
ci: Filter out PRs from update-issues tool (#3904)
Browse files Browse the repository at this point in the history
The tool isn't (yet) intended to maintain PR labels, and the workflow
doesn't have permissions to update PRs.
  • Loading branch information
joeyparrish committed Jan 25, 2022
1 parent a65a1cd commit 69b2769
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/tools/update-issues/issues.js
Expand Up @@ -303,6 +303,8 @@ class Issue extends GitHubObject {
this.locked = obj.locked;
/** @type {Milestone} */
this.milestone = obj.milestone ? new Milestone(obj.milestone) : null;
/** @type {boolean} */
this.isPR = !!obj.pull_request;
}

/**
Expand Down Expand Up @@ -519,9 +521,11 @@ class Issue extends GitHubObject {

/** @return {!Promise<!Array<!Issue>>} */
static async getAll() {
return GitHubObject.getAll(octokit.rest.issues.listForRepo, Issue, {
state: 'all',
});
const all = await GitHubObject.getAll(
octokit.rest.issues.listForRepo, Issue, {
state: 'all',
});
return all.filter(issue => !issue.isPR);
}
}

Expand Down

0 comments on commit 69b2769

Please sign in to comment.