7
1

More than 3 years have passed since last update.

Github API v3でPRを作るcurlコマンド例

Last updated at Posted at 2020-01-17

参照:https://developer.github.com/v3/pulls/#create-a-pull-request
パラメータの作り方で少しハマった

# Personal access token
TOKEN=00000000000000000 
OWNER=username
REPO=repositry
COMPARE=username:branch
BASE=master

curl -v -H "Authorization: token $TOKEN" https://api.github.com/repos/$OWNER/$REPO/pulls --data '
{
  "title": "Amazing new feature",
  "body": "Please pull these awesome changes in!",
  "head": "'$COMPARE'",
  "base": "'$BASE'"
}'

--request POSTは推論されるので不要でした。

Personal access tokenの権限

repo Full control of private repositoriesがいる

  • [Check] repo Full control of private repositories
    • repo:status Access commit status
    • repo_deployment Access deployment status
    • public_repo Access public repositories
    • repo:invite Access repository invitations
7
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
1