pozil / auto-assign-issue

GitHub Action that auto-assigns issues or PRs to one or more users
Creative Commons Zero v1.0 Universal
53 stars 32 forks source link

Enhancement to use Github "Team" instead of individual user #19

Closed ajaydwarkani closed 2 years ago

ajaydwarkani commented 2 years ago

Hi, can this action be further enhanced to specify the Github team instead of the Github username?

pozil commented 2 years ago

Hi @ajaydwarkani, good idea. I've just implemented this in the latest version.

ajaydwarkani commented 2 years ago

@pozil , YOU ROCK!

I am getting below error after using your latest changes

auto-assign
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter ''using: node14' is not supported, use 'docker', 'node12' or 'node16' instead.')
   at GitHub.Runner.Worker.ActionManifestManager.ConvertRuns(IExecutionContext executionContext, TemplateContext templateContext, TemplateToken inputsToken, String fileRelativePath, MappingToken outputs)
   at GitHub.Runner.Worker.ActionManifestManager.Load(IExecutionContext executionContext, String manifestFile)

Here is my configuration

name: Issue assignment

on:
  issues:
    types: [opened]

jobs:
  auto-assign:
    runs-on: ubuntu-latest
    steps:
      - name: 'Auto-assign issue'
        uses: pozil/auto-assign-issue@v1.2.0
        with:
           teams: autoIssueTeam
pozil commented 2 years ago

Hi @ajaydwarkani, thanks for letting me know. I didn't realize that the default GitHub Action runner wasn't supporting Node 14. I've rollbacked to node 12 with a new version (v1.3.0) and I fixed another issue with teams. I also added an important requirement in the readme: you must use a personal access token, the default token is not enough to read teams' info.

ajaydwarkani commented 2 years ago

Thanks @pozil for a quick fix :). It's working as expected. I had to create a personal token with "workflow" access.

With no workflow access, you may get the below error.

(node:1517) UnhandledPromiseRejectionWarning: HttpError: Must have admin rights to Repository.

The solution to fix this is by enabling just the "workflow" access option when creating the personal token.

image