gr2m / octokit-plugin-create-pull-request

Octokit plugin to create a pull request with multiple file changes
MIT License
104 stars 28 forks source link

Feature request: to create a PR with a label #102

Closed oscard0m closed 1 year ago

oscard0m commented 2 years ago

Would it be possible to extend this plugin to give support to creating a PR with a label?

Relates to https://github.com/wolfy1339/octoherd-script-remove-eol-node-versions/issues/3

gr2m commented 2 years ago

Sure, we can add a .labels option that can be set to an array of label names?

wolfy1339 commented 2 years ago

The endpoint accepts multiple labels as an array when using @octokit/request, it makes sense to follow that

oscard0m commented 2 years ago

The endpoint accepts multiple labels as an array when using @octokit/request, it makes sense to follow that

I'm a bit confused with labels parameter:

It's GitHub's Documentation wrong or our types are wrong? Or there is something I'm not understanding.

[^1]: @octokit/request.js README [^2]: TypeScript Playground using octokit.request() with labels

gr2m commented 2 years ago
  • And GitHub's cli offers creating a pr with labels (gh pr create --label label1,label2,label3) so I'm assuming is possible.

it's probably two requests

  • but I see it in the README.md here

The request is not to create a pull request, the example is showing POST /repos/{owner}/{repo}/issues/{number}/labels

oscard0m commented 2 years ago
  • but I see it in the README.md here

The request is not to create a pull request, the example is showing POST /repos/{owner}/{repo}/issues/{number}/labels

🤦🏽 I misread it.

github-actions[bot] commented 1 year ago

:tada: This issue has been resolved in version 5.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: