Skip to content

Commit

Permalink
fix: ignore closed PRs/issues
Browse files Browse the repository at this point in the history
  • Loading branch information
z0al committed Nov 26, 2020
1 parent 8c6ec00 commit fba59c1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
11 changes: 6 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,18 @@ export async function getActionContext(): Promise<ActionContext> {

// Only run checks for the context.issue (if any)
if (issue?.number) {
issues = [
(await client.issues.get({ ...repo, issue_number: issue.number }))
.data,
];
const remoteIssue = (
await client.issues.get({ ...repo, issue_number: issue.number })
).data;

// Ignore closed PR/issues
if (remoteIssue.state === 'open') {
issues = [remoteIssue];
}
}

// Otherwise, check all open issues
if (issues.length === 0) {
else {
const options = {
...repo,
state: 'open' as 'open',
Expand Down

0 comments on commit fba59c1

Please sign in to comment.