Giter Club home page Giter Club logo

auto-assign's Introduction

Auto Assign

Automatically add reviewers/assignees to issues/PRs

  • Randomly pick assignees and reviewers from candidate list.
  • Automatically ignore invalid Github username.
  • Automatically skip assigned issues/PRs and reviewer requested PRs.
  • Try-to pick the member of team as assignee when adding team to assignees.

Note that the default ${{ secrets.GITHUB_TOKEN }} does not have the permission to add teams as reviewers or to list members of a team. As a workaround:

  • First, create a personal access token (PAT) with repo and admin:org permissions.
  • Then, make the PAT available to our actions by adding the token as a secret.
  • Finally, replace the GITHUB_TOKEN with the new secret, e.g. GITHUB_TOKEN: ${{ secrets.NAME_OF_MY_SECRET_CONTAINING_PAT_WITH_REPO_ACCESS }} instead of GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}.

Or with a cool but slightly cumbersome solution: create a private github app for your org with custom permissions and avatar, then use the app token in out workflow, e.g. wow-actions-bot.

Usage

Create .github/workflows/auto-assign.yml in the default branch:

name: Auto Assign
on:
  issues:
    types: [opened, edited, labeled, unlabeled]
  pull_request:
    types: [opened, edited, labeled, unlabeled]
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - uses: wow-actions/auto-assign@v3
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          # using the `org/team_slug` or `/team_slug` syntax to add git team as reviewers
          reviewers: |
            reviewer1
            reviewer2
            reviewer3
            org/teamReviewerA
            org/teamReviewerB
            /teamReviewerC
          assignees: assignee1, assignee2, assignee3
          skipKeywords: wip, draft

Inputs

Various inputs are defined to let you configure the action:

Note: Workflow command and parameter names are not case-sensitive.

Name Description Default
GITHUB_TOKEN The GitHub token for authentication N/A
addReviewers Set to true to add reviewers to PRs. true
addAssignees Set to true to add assignees to issues/PRs. true
reviewers Candidate list of reviewers(GitHub username) to be added to PR. []
assignees Candidate list of assignees(GitHub user name) to be added to issue/PR. Uses reviewers if not set. []
numberOfReviewers Number of reviewers added to the PR. Set 0 to add all the reviewers. 0
numberOfAssignees Number of assignees added to the issue/PR. Set 0 to add all the assignees. Uses numberReviewers if not set. 0
skipDraft Set to false to run on draft PRs. true
skipKeywords A list of keywords to be skipped the process if issue/PR's title include it. []
includeLabels Only to run when issue/PR has one of the label. []
excludeLabels Not to run when issue/PR has one of the label. []

License

The scripts and documentation in this project are released under the MIT License.

auto-assign's People

Contributors

bubkoo avatar semantic-release-bot avatar wow-actions-bot[bot] avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.