octokit / octokit.js

The all-batteries-included GitHub SDK for Browsers, Node.js, and Deno.
MIT License
6.97k stars 1.02k forks source link

[BUG]: Filtering pull requests by branch doesnt work #2710

Open lumattr opened 3 months ago

lumattr commented 3 months ago

What happened?

Im trying to use the head query parameter as the documentation suggests but im not getting anything back. Even using the branches own label nothing gets returned.

const pull = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', { 
  owner, repo, headers,
  pull_number: 91
})
console.log(pull.data.head.label)

const pulls = await octokit.request('GET /repos/{owner}/{repo}/pulls', { 
  owner, repo, headers,
  head: pull.data.head.label
})
console.log(pulls.data)

Versions

@octokit/core 6.1.2, Node v20.12.2

Relevant log output

❯ node main.mjs
org:branchname
[]

Code of Conduct

github-actions[bot] commented 3 months ago

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀