Convert issue to pull request with Github API

Here is an example for doing a pull request from fork: nacho4d branch: feature/fix-xcode-configure-file to meson to branch master.
Instead of creating a new shiny pull request I am converting an existing issue 4296 into a pull request. Which is nice because in that issue we were discussing all things I have done in the pull request :)
curl \
  --user "nacho4d:password-of-nacho4d" \
  --request POST \
  --data '{ \
      "issue":4296, \
      "head":"nacho4d:feature/fix-xcode-configure-file", \
      "base":"master"}' \
  https://api.github.com/repos/mesonbuild/meson/pulls
To make it more real, we should use avoid passing the password in this way (because user:password will be recorded in terminal history and potencially seen by someone else, etc).

Instead of --user user:password \ just omit the password and curl will ask for the password everytime or even better use an authorization token --header Authorization: YOUR_TOKEN_HERE' \

Github's official documentation:
Hope this helps :)

0 comments :

This work is licensed under BSD Zero Clause License | nacho4d ®