Skip to content

Commit 2494188

Browse files
committed
narrow down
1 parent 6bbe320 commit 2494188

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/index.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,20 @@ const octokit = new Octokit();
55
const [owner, repo] = process.env.GITHUB_REPOSITORY?.split("/")!;
66
const pull_request_number = parseInt(process.env.GITHUB_REF?.split("/")[2]!);
77

8-
// const { data: pullRequest } = await octokit.rest.pulls.get({
9-
// owner,
10-
// repo,
11-
// pull_number: pull_request_number,
12-
// });
8+
const { data: pullRequest } = await octokit.rest.pulls.get({
9+
owner,
10+
repo,
11+
pull_number: pull_request_number,
12+
});
1313

1414
const { data: actions } = await octokit.rest.actions.listWorkflowRunsForRepo({
1515
owner,
1616
repo,
1717
});
1818

1919
const workflow_runs = actions.workflow_runs.filter(
20-
(action) => action.status === "completed"
20+
(action) =>
21+
action.head_branch === pullRequest.head.ref && action.status === "completed"
2122
);
2223

2324
if (workflow_runs.length === 0) {

0 commit comments

Comments
 (0)