Giter VIP home page Giter VIP logo

auto-assign-action's Introduction

๐Ÿ‘‹ Hello, I'm Kentaro!

I'm a web developer in Kanazawa, Japan. I've created some tools to improve productivity for developers.

๐Ÿ’– Support my projects on GitHub Sponsor

๐Ÿ˜„ About me

  • ๐Ÿ”ญ I'm working to improve gaming platform at EXNOA LLC.
  • ๐ŸŒฑ Iโ€™m learning GraphQL, React and TypeScript.

๐ŸŒŽ Find me on the web

  • ๐Ÿฆ Tweeting my daily life on Twitter
  • ๐ŸŽ™๏ธ Sharing my talks on Speaker Deck
  • ๐Ÿ“ Writing technical articles on Blog

๐Ÿ“ซ Get in touch

auto-assign-action's People

Contributors

benjlevesque avatar dependabot[bot] avatar evantianx avatar extreme4all avatar gsvarma avatar ikesyo avatar kentaro-m avatar markdorison avatar mtxr avatar renovate[bot] avatar siwalikm-plivo avatar tagoro9 avatar willpoulson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

auto-assign-action's Issues

Explain the purpose of review groups

Gretings!

I did not understand why would anyone use groups with the current implementation. For example, assume that I am devA.

# Single list
reviewers:
  - devA
  - devB
  - devC
  - devD
# Multiple groups
useReviewGroups: true
reviewGroups:
  fe:
    - devA
    - devB
  be:
    - devC
    - devD

In both cases, all the other 3 devs will be assigned.

I expected that, because I belong to team fe, only devB would be assigned. Instead, the result is the same of using a single list.

numberOfReviewers is misleading when useReviewGroups is enabled

Assuming the following configuration, I'd expect that only one reviewer would be selected given that numberOfReviwers is set to 1, instead, it returns 3 values: user1, user2, and a user in the charlie group.

addReviewers: true

numberOfReviewers: 1

useReviewGroups: true

reviewGroups:
  alpha:
    - user1
  bravo:
    - user2
  charlie:
    - user3
    - user4
    - user5

I believe either the name of the configuration numberOfReviwers is misleading when useReviewGroups is enabled, or there's a bug where it assigns more than one reviewer to the PR.

I can work on a PR to fix the problem, I just need to know which approach you guys think it's the best. Personally, I think numberOfReviewers should always be respected regardless of the number of developers each group has. I'd also include a configuration to the group, so it can select one or multiple developers per group to be used later by the numberOfReviewers variable.

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>kentaro-m/renovate-config)

Reviewer re-request review after approved

Hi, @kentaro-m currently we have a problem when reviewer approved the PR & any file changed in PR, reviewer got re-request review (not always happens and I don't know the trigger of this) Do you know anything about this?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/pull-request.yml
  • kentaro-m/auto-assign-action v2.0.0
.github/workflows/release-note.yml
  • release-drafter/release-drafter v5
.github/workflows/test.yml
  • actions/checkout v4
  • actions/setup-node v4
nodenv
.node-version
  • node 20.12.2
npm
package.json
  • @actions/core ^1.6.0
  • @actions/github ^5.0.0
  • js-yaml ^3.13.1
  • lodash ^4.17.20
  • @octokit/webhooks-types 7.5.1
  • @types/jest 29.4.0
  • @types/js-yaml 3.12.1
  • @types/lodash 4.14.141
  • @types/node 20.11.13
  • @vercel/ncc 0.38.1
  • husky 8.0.3
  • jest 29.7.0
  • jest-circus 29.7.0
  • jest-mock 29.7.0
  • lint-staged 13.3.0
  • prettier 3.2.5
  • ts-jest 29.1.2
  • typescript 5.4.5

  • Check this box to trigger a request for Renovate to run again on this repository

If reviewers already assigned, skip

We are finding it annoying when a PR requester takes care to request specific people to review a PR, then the action comes along and adds more. A great flag would be to be able to skip adding reviews if the numberOfReviewers has been met or to skip adding reviews completely in this case.

Auto-assign the original author + another member

As Github does, it will be beneficial to assign a person who has authored the code before the PR.
Also, a person who is never involved with the code.

Note: If everyone is already involved with the code, then the action can also randomly choose people.

Keep getting Bad_Credentials error

name: On Open PR Actions

on:
pull_request:
# types: [opened]

jobs:
auto-assign:
permissions: write-all
runs-on: self-hosted
steps:
- name: Auto Assign Action
uses: kentaro-m/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}

I keep getting Bad Credentials error despite of token having write permissions. What am I missing?

GITHUB_TOKEN Permissions
Actions: write
Checks: write
Contents: write
Deployments: write
Discussions: write
Issues: write
Metadata: read
Packages: write
Pages: write
PullRequests: write
RepositoryProjects: write
SecurityEvents: write
Statuses: write
Secret source: Actions
Prepare workflow directory
Prepare all required actions

Error: Bad credentials

Enable Dependabot and fix the security issues.

Hi Could you please enable dependabot on this repository? We would like to use this action but we cannot use it since we see a critical issue when we do a scan on the repository.
Issue we see is the following;

  • Babel vulnerable to arbitrary code execution when compiling specifically crafted malicious code

Does not add a reviewer

I have the config as presented below. The action is adding the author but does not adds me as a reviewer.

addReviewers: true
addAssignees: author
reviewers:
  - Power-Maverick
numberOfReviewers: 0

numberOfReviewers does not default to 0

In my tests numberOfReviewers does not default to 0. If I omit numberOfReviewers: 0 then only one reviewer is added. If I explicitly add numberOfReviewers: 0 then all the reviewers I listed are added, which is the behavior I was looking for.

`[warning]Resource not accessible by integration` when running against PRs

Given the following workflow:

name: 'Auto Assign PR Reviewers'
on: pull_request

jobs: 
  add-reviews:
    runs-on: ubuntu-latest
    steps:
      - uses: kentaro-m/[email protected]
        with: 
          configuration-path: ".github/auto_assign.yml"
          repo-token: '${{ secrets.GITHUB_TOKEN }}'

And the following auto_assign.yml:

addReviewers: true
addAssignees: author

reviewers:
  - nrb
  - ashish-amarnath
  - carlisia

I see the following output when running this action against all PRs

Run kentaro-m/[email protected]
  with:
    configuration-path: .github/auto_assign.yml
    repo-token: ***
##[warning]Resource not accessible by integration
##[warning]Resource not accessible by integration

I'm not quite sure what I've got wrong. You can see the directory structure at https://github.com/vmware-tanzu/velero/tree/main/.github

I was also seeing this behavior without the GITHUB_TOKEN, and added it thinking that would give the action access to act on the repository.

Set up job failed

I use this workflow at my repo:

.github
โ”œโ”€โ”€ auto_assign.yml
โ””โ”€โ”€ workflows
    โ””โ”€โ”€ pre_cr.yml

auto_assign.yml:

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

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

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

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

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

pre_cr.yml:

name: 'Pre-CR | Assign Reviewer'
on: pull_request

jobs:
  add-reviews:
    runs-on: ubuntu-latest
    steps:
      - uses: kentaro-m/auto-assign-action@v1
        with:
          repo-token: '${{ secrets.GITHUB_TOKEN }}'

I received an error during the job setting up:

Current runner version: '2.160.2'
Prepare workflow directory
Prepare all required actions
Download action repository 'kentaro-m/auto-assign-action@v1'
##[warning]Failed to download action 'https://api.github.com/repos/kentaro-m/auto-assign-action/tarball/v1'. Error Response status code does not indicate success: 404 (Not Found).
##[warning]Back off 21.548 seconds before retry.
##[warning]Failed to download action 'https://api.github.com/repos/kentaro-m/auto-assign-action/tarball/v1'. Error Response status code does not indicate success: 404 (Not Found).
##[warning]Back off 14.766 seconds before retry.
##[error]Response status code does not indicate success: 404 (Not Found).

Did I miss something? Thanks for helping in advance.

Update:

solved by changing v1 to v1.0.1

Assignees enhancement - Option to include Author (ie. owner) in conjunction with other auto-assignees.

Taking a look at the code, it appears that the owner / author can not be an assignee in conjunction with other assignees.

https://github.com/kentaro-m/auto-assign-action/blob/master/src/utils.ts

For example:

addAssignees: true

assignees:
  - contributor1
  - contributor2
  - contributor3
  - contributor4
  - contributor5
  - contributor6

numberOfAssignees: 6

When contributor1 is the author/owner of the PR, they won't be included even the numberOfAssignees is a number large enough to include them in the sample of the collection.


Issue: I'm wondering what the intent is for this logic, and if the project is open to allowing an option in the config to include author/owner along with other assignees.

Allow teams to be auto-assigned

This would be a nice feature to have, I tested this thinking it might work, but it unfortunately doesn't. When you try to assign a team as a reviewer, the workflow will succeed, but the PR will not have the team added as a reviewer.

Allow specification of number of people to select from each group

I might be missing it, but if not, it would be cool if the configuration allowed for specification to the number of reviewers to be selected from each review group. For example

numberOfReviewersGroupA: 1

numberOfReviewersGroupB: 2

reviewGroups:
  groupA:
    - foo
    - bar
  groupB:
    - foobar
    - baz
    - foobaz

I understand this may be a bit challenging to pull off, but throwing it out there.

Assign project?

We would like to also have an option to assign a github project for the PR
image

Node.js 12 actions are deprecated

We are getting an error in our CI that is using 'Auto Assign Action'.

Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: kentaro-m/auto-assign-action

Could you please update action.yml to use Node 16?

runs: using: 'node16'

Group of reviewers per label

Hello ๐Ÿ‘‹
Not sure if this is a feature of this action, but is it possible to auto-assign reviewers based on a specific label?

Example, if the label backend is applied only reviewers from the backend group would be assigned to the PR. Same for the frontend label.

# 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:
  backend:
    - reviewerA
    - reviewerB
    - reviewerC
  frontend:
    - reviewerD
    - reviewerE
    - reviewerF
    - 
filterLabels:
  include:
    - backend
    - frontend
  # Not run
  exclude:
    - wip

Thank you.

Warnning "Resource not accessible by integration" reported and no reviewers are assigned.

I was trying out this action, but an warning "Resource not accessible by integration" was reported and no reviewers were assigned.

The output is here: https://github.com/bluven-org/test/actions/runs/5374670624/jobs/9750300069

My action config:

jobs:
  add-reviews:
    runs-on: ubuntu-latest
    permissions: write-all
    steps:
      - uses: kentaro-m/[email protected]
        with:
          configuration-path: '.github/reviewers2.yaml' # Only needed if you use something other than .github/auto_assign.yml

"Review can not be requested from author"

4 developers work on a single repo. If one developer creates a PR, and he is in the "reviewers" list, action fails with "Review can not be requested from author".

Expected behavior:
Author is skipped, all other users added as reviewers.

Actual behavior:
0 reviewers added.

Config:

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

# Set to author to set pr creater as assignee
addAssignees: author

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
  - deva
  - devb
  - devc
  - devd

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

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

Allow assignment on pull_request_review action

Hi we are trying to set up this action such that when a PR is approved by a developer this action will auto-assign a QA engineer. The following is my GitHub action and auto-assign-action config. When this is used however the message Warning: Empty value for parameter 'pull_number': undefined is shown. I believe this is because we are using the pull_request_review action instead of pull_request or pull_request_target and so the PR number cannot be found. Is there a way to do this today or is a change required to add this functionality?

.github/auto_assign_qa.yml

addReviewers: true
addAssignees: false

reviewers:
  - samkio

numberOfReviewers: 0

.github/workflows/qa-assign.yml

name: "Auto assign QA reviewers"
on:
  pull_request_review:
    types: [submitted]
jobs:
  add-qa-reviewers:
    if: github.event.review.state == 'approved'
    runs-on: ubuntu-latest
    steps:
      - uses: actions-ecosystem/action-add-labels@v1
        with:
          labels: "ready for test"
      - uses: kentaro-m/[email protected]
        with:
          configuration-path: ".github/auto_assign_qa.yml"

Log:

Run kentaro-m/[email protected]
  with:
    configuration-path: .github/auto_assign_qa.yml
    repo-token: ***
Warning: Empty value for parameter 'pull_number': undefined

Allow overriding the default draft skip behavior

There should be a configuration setting to override the default behavior which skips draft PRs.
In my case, I'd like the github action to assign the author regardless if it's a draft/non-draft PR.

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.