Add/remove label to/from pull request

Is it possible to add/remove labels to/from pull request via GitHub Actions? There is this action https://github.com/actions/github-script and one example shows how to add label to an issue. It is using octokit which is pretty straight forward. But I couldn’t find a way to do same for PRs. Is anybody having the same problem?

script: |
  github.issues.addLabels({...context.issue, labels: ['Triage']})

Found solution myself in GitHub API developer docs:

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.

https://developer.github.com/v3/pulls/#labels-assignees-and-milestones

1 Like