#git (2020-08)
All things git (except gitops)
2020-08-05
![Matt Gowie avatar](https://avatars.slack-edge.com/2023-02-06/4762019351860_44dadfaff89f62cba646_72.jpg)
@Matt Gowie has joined the channel
2020-08-27
![Marcin Brański avatar](https://secure.gravatar.com/avatar/7f3c56304d6e3adb7658889af56cd171.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-72.png)
I’m trying to add labels to PRs with github CLI. Docs state that PR is an issue https://developer.github.com/v3/pulls/#labels-assignees-and-milestones And docs for issue state how to update issue with label https://developer.github.com/v3/issues/#update-an-issue But not yet sure how to do it for PR.
Anyone done it?
![Marcin Brański avatar](https://secure.gravatar.com/avatar/7f3c56304d6e3adb7658889af56cd171.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-72.png)
Every pull request is an issue, but not every issue is a pull request. For this reason, “shared” actions for both features, like manipulating assignees, labels and milestones, are provided within the Issues API.
![Marcin Brański avatar](https://secure.gravatar.com/avatar/7f3c56304d6e3adb7658889af56cd171.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0001-72.png)
Got it
echo '{"labels":["test"]}' | gh api -X PATCH repos/:owner/:repo/issues/3 --input -
issues
doesn’t take :pull_number
so PR number must be known to use it.