Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

GitHub action that auto-assigns issues to users or team members

CI Workflow codecov GitHub Marketplace

Inputs

Parameter Type Required Description
assignees String only if teams is not specified Comma separated list of user names. Issue will be assigned to those users.
teams String only if assignees is not specified Comma separated list of teams. Issue will be assigned to the team members.

Important Requirement: if using the teams input parameter, you need to use a personal access token with read:org scope (the default GITHUB_TOKEN is not enough).
numOfAssignee Number false Number of assignees that will be randomly picked from the teams or assignees. If not specified, assigns all users.
removePreviousAssignees Boolean false Flag to remove previous assignees before assigning new ones (useful if the issue is reasigned due to some changes). False by default.

Examples

Here's an example flow that auto-assigns all new issues to two users randomly chosen from octocat, cat and dog :

name: Issue assignment

on:
    issues:
        types: [opened]

jobs:
    auto-assign:
        runs-on: ubuntu-latest
        steps:
            - name: 'Auto-assign issue'
              uses: pozil/[email protected]
              with:
                  assignees: octocat,cat,dog
                  numOfAssignee: 2

This other configuration assigns issues to a random member of the support team:

- name: 'Auto-assign issue'
    uses: pozil/[email protected]
    with:
        repo-token: ${{ secrets.MY_PERSONAL_ACCESS_TOKEN }}
        teams: support
        numOfAssignee: 1

Specifying a dynamic user

Instead of hardcoding the user name in the workflow, you can use a secret:

  • create a GitHub secret named DEFAULT_ISSUE_ASSIGNEE with the name of the user
  • use this value ${{ secrets.DEFAULT_ISSUE_ASSIGNEE }} instead of the username in the workflow.