Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

The GitHub Actions assigns reviewers & changes the status labels.

License

Notifications You must be signed in to change notification settings

cats-oss/github-action-auto-assign

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

GitHub Action to assign a reviewer by comment command.

CircleCI

Motivation

  • We don't manage any bot instance for this purpose.
  • We'd like to use managed service to host this kind of a bot.
  • Try GitHub Actions :)
    • Investigate its latency & its throughput for chat bot purpose.

Special Command List

  • You can use these command as a comment for issue or pull request or pull request review.
  • Your comment change some status of the issue you commented.
  • This actions treats S- prefixed labels exclusively.
    • e.g. If your pull request is labeled with S-a and S-b, then this action replaces them with S-c.
  • If your comment has multiple line, this action interprets only the first line of it.
  • To support the command style which bors-ng uses, you can write botname <this action command>.
    • e.g. bors r+ is ok.

r? @username1 @username2

  • This assigns @username1 and @username2 to assignees filed.
  • This adds the label S-awaiting-review.

r+ or r=username1, username2

  • This assigns the user who opens the issue to assignees filed.
  • This adds the label S-awaiting-merge.

r-

  • This assigns the user who opens the issue to assignees filed.
  • This adds the label S-need-code-change.

Setup

Add this example to your GitHub Actions workflow configuration.

YAML syntax

name: assign_review_by_comment by issue_comment
on: [issue_comment, pull_request_review]

jobs:
  assign_review_by_comment:
    runs-on: ubuntu-latest
    steps:
    - name: assign_review_by_comment
      # We recommend to use an arbitary latest version
      # if you don't have any troubles.
      # You can also specify `master`, but it sometimes might be broken.
      uses: cats-oss/github-action-auto-assign@v2
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Limitations

  • By the Limitation of the current GitHub Actions, this might not works your repository well.
    • Because GitHub Actions is still in beta.
    • We confirms this works with a private repository. But we have not confirmed yet to work with a public one.

Known Problems

This action could not interact with my comment in a few seconds.

  • We know that this action takes ~30sec to react user comment.
  • We think this is the current or fundamental limitation of GitHub Actions. See #6.