Skip to content

An action which adds reviewers to the pull request when the pull request is opened.

License

Notifications You must be signed in to change notification settings

acorretti/review-upon-keywords-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace
 
 

Repository files navigation

Review Upon Keywords Action

An action which adds reviewers to the pull request when the pull request body matches specific keywords.

Based on auto-assign-action by @kentaro-m.

▶️ Usage

Create a workflow (e.g. .github/workflows/action.yml For more detail, refer to Configuring a workflow) for running the action.

name: 'Review Upon Keywords'
on:
    pull_request:
        types: [opened, ready_for_review]

jobs:
    add-reviews:
        runs-on: ubuntu-latest
        steps:
            - uses: acorretti/[email protected]
              with:
                  configuration-path: '.github/some_name_for_configs.yml' # Only needed if you use something other than .github/review_upon_keywords.yml

Create a separate configuration file for the action (e.g. .github/review_upon_keywords.yml).

Single Reviewers List

Add reviewers/assignees to the pull request based on single reviewers list.

# Set to true to add reviewers to pull requests
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: false

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
    - reviewerA
    - reviewerB
    - reviewerC

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 0
# A list of assignees, overrides reviewers if set
# assignees:
#   - assigneeA

# A number of assignees to add to the pull request
# Set to 0 to add all of the assignees.
# Uses numberOfReviewers if unset.
# numberOfAssignees: 2

# A list of keywords to be skipped the process that add reviewers if pull requests include it
# titleKeywordsToSkip:
#   - wip

# Keywords to match in the PR diff in order for this action to be applied
# diffKeywords:
#   - some-matching-string

Multiple Reviewers List

Add reviewers/assignees to the pull request based on multiple reviewers list.

If you and peers work at the separate office or they work at the separate team by roles like frontend and backend, you might be good to use adding reviewers from each group.

# Set to true to add reviewers to pull requests
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: false

# A number of reviewers added to the pull request
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 1

# A number of assignees to add to the pull request
# Set to 0 to add all of the assignees.
# Uses numberOfReviewers if unset.
# numberOfAssignees: 2

# Set to true to add reviewers from different groups to pull requests
useReviewGroups: true

# A list of reviewers, split into different groups, to be added to pull requests (GitHub user name)
reviewGroups:
    groupA:
        - reviewerA
        - reviewerB
        - reviewerC
    groupB:
        - reviewerD
        - reviewerE
        - reviewerF

# Set to true to add assignees from different groups to pull requests
useAssigneeGroups: false
# A list of assignees, split into different froups, to be added to pull requests (GitHub user name)
# assigneeGroups:
#   groupA:
#     - assigneeA
#     - assigneeB
#     - assigneeC
#   groupB:
#     - assigneeD
#     - assigneeE
#     - assigneeF

# A list of keywords to be skipped the process that add reviewers if pull requests include it
# titleKeywordsToSkip:
#   - wip

# Keywords to match in the PR diff in order for this action to be applied
# diffKeywords:
#   - some-matching-string

Assign Author as Assignee

Add the PR creator as the assignee of the pull request.

# Set addAssignees to 'author' to set the PR creator as the assignee.
addAssignees: author

Filter by label

The action will only run if the PR meets the specified filters

filterLabels:
    # Run
    include:
        - my_label
        - another_label
    # Not run
    exclude:
        - wip

Filter by PR diff keywords

The action will only run if the PR contains the specified keywords in any added line, in any commit. Matches are case insensitive.

diffKeywords:
    - some-matching-string
    - another-keyword

📝 License

MIT

About

An action which adds reviewers to the pull request when the pull request is opened.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.5%
  • JavaScript 0.5%