File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,16 @@ exports.action = async function action() {
8989 }
9090} ;
9191
92+ async function getPull ( { org, repoName, pullNumber } ) {
93+ return (
94+ await octokit . rest . pulls . get ( {
95+ owner : org ,
96+ repo : repoName ,
97+ pull_number : pullNumber ,
98+ } )
99+ ) . data ;
100+ }
101+
92102async function actionIssue ( ) {
93103 console . info ( `Calling action on issue` ) ;
94104 const { owner, repo, issueNumber, comment } = await getActionParameters ( ) ;
@@ -98,9 +108,18 @@ async function actionIssue() {
98108 return ;
99109 }
100110
111+ const pull = await getPull ( {
112+ org : owner ,
113+ repoName : repo ,
114+ pullNumber : issueNumber ,
115+ } ) ;
116+ const {
117+ head : { ref : headRef } ,
118+ } = pull ;
119+
101120 const workflowRuns = await octokit . paginate (
102121 "GET /repos/{owner}/{repo}/actions/runs" ,
103- { owner, repo, issue_number : issueNumber }
122+ { owner, repo, branch : headRef }
104123 ) ;
105124 const reviewWorkflows = workflowRuns . filter (
106125 ( { name, event, pull_requests : pullRequests } ) =>
You can’t perform that action at this time.
0 commit comments