I am trying to create a pull request along with labels included during creation. I am aware this can be done in GitHub UI, but is it possible to do the same using REST API programatically?
The API documentation for creating a pull request doesn't mention specifying labels: https://docs.github.com/en/rest/reference/pulls#create-a-pull-request
I used the following command to create a PR:
execute_command_with_output(
'curl --silent -X POST -H "Authorization: token {}" -H "Accept: application/vnd.github.v3+json" '
'{}/repos/{}/pulls -d \'{{"head":"{}","base":"{}","title":"{} Cherry-Pick from PR {}","labels":"bug"}}\''.format(
token, url, repository, t_branch, b_branch, ticket, pr
),