Assign
Assign a pull request to a user.
The assign
action allows you to assign one or more users to a pull request
when the conditions you specify are met. This can help automate the process of
designating the right people to handle specific pull requests, based on your
conditions. This can significantly streamline your pull request management
process and ensure that the right people are always aware of and working on the
pull requests that require their attention.
Parameters
Key name | Value type | Default | |
---|---|---|---|
add_users | list of template | ||
The users to assign to the pull request. | |||
remove_users | list of template | ||
The users to remove from assignees. |
As the list of users in add_users
or remove_users
is based on
templates, you can use, e.g., {{author}}
to assign the
pull request to its author.
Make sure the users you specify in the assign action have the necessary access to the repository and the pull request. If the specified user does not have the necessary permissions, the action will fail.
Examples
Assign Defined User
Below is an example of how to use the assign
action:
pull_request_rules:- name: assign PR to a userconditions:- "#files=1"actions:assign:add_users:- "username1"- "username2"
Assign Pull Request Author User
Below is an example of how to use the assign
action to assign a pull request
to its author:
pull_request_rules:- name: assign PR to its authorconditions:- "#files=1"actions:assign:add_users:- "{{author}}"