Skip to content

Commit

Permalink
Enable posting to closed PRs
Browse files Browse the repository at this point in the history
In case PR is closed before results finished, we should still update comment with latest results.
  • Loading branch information
andrewiggins committed Feb 15, 2021
1 parent b98eaa4 commit db08f9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
15 changes: 7 additions & 8 deletions dist/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -11301,14 +11301,13 @@ async function parseContext(context, github, logger) {

// 2.2. Search the PR API for matching open PRs if 0 or more than 1
// matched from the payload (payload doesn't contain open or close state)
prs = (
await github.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: "open",
head: headLabel,
})
).data;
let res = await github.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
head: headLabel,
});

prs = res.data;
}

if (prs.length === 0) {
Expand Down
15 changes: 7 additions & 8 deletions src/utils/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ async function parseContext(context, github, logger) {

// 2.2. Search the PR API for matching open PRs if 0 or more than 1
// matched from the payload (payload doesn't contain open or close state)
prs = (
await github.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: "open",
head: headLabel,
})
).data;
let res = await github.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
head: headLabel,
});

prs = res.data;
}

if (prs.length === 0) {
Expand Down

0 comments on commit db08f9a

Please sign in to comment.