File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,19 +5,20 @@ const octokit = new Octokit();
55const [ owner , repo ] = process . env . GITHUB_REPOSITORY ?. split ( "/" ) ! ;
66const 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
1414const { data : actions } = await octokit . rest . actions . listWorkflowRunsForRepo ( {
1515 owner,
1616 repo,
1717} ) ;
1818
1919const 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
2324if ( workflow_runs . length === 0 ) {
You can’t perform that action at this time.
0 commit comments