Comments (17)
A couple of weeks ago, I went and tested every permutation I could thing of for this:
- "@org/team"
- "org/team"
- team
- "@team"
- "The Org Team Long Name"
None of these appeared to work.
from auto-assign-action.
Just came across this action and thought it was a perfect solution to my needs! But it seems I am just here to add my +1 to this issue as a desired feature.
I see it's been around since December 2019, with last update in August 2020, so i'm guessing that this project may not be particularly active, which is unfortunate.
@kentaro-m Are you able to weigh in on this at all?
I believe that GitHub users aren't allowed to have a /
in their name, and at least in the cases I have seen, groups will always have a /
in their name. So perhaps we can split this list of users to assign into 'users' and 'groups' and pass them into the appropriate separate fields in the addUsers
call as mentioned by @Nadock in #12 (comment)
I was trying to fix this but I have no idea how to compile the lib outputs of tsc to dist/index.js so that I can test it.
@TMaYaD Do the package scripts build
and/or package
help with this at all?
https://github.com/kentaro-m/auto-assign-action/blob/master/package.json#L10-L16
from auto-assign-action.
+1 need possibility to assign team as reviewer
from auto-assign-action.
I'm also having the same issue. I'm trying to assign a team as the PR reviewer but it's not working.
In the log output of the action run it says:
Added reviewers to PR #NNN: @org/team
Which is what you expect, except in the UI the team org/team
isn't assigned. (real names omitted)
If you look at the GitHub REST API for adding pull request reviewers, team reviewers are supposed to be supplied separately from regular user reviewers. However, a brief dive into the code for this action shows that only the reviewers
parameter is supplied - not the team_reviewers
parameter, see:
auto-assign-action/src/pull_request.ts
Line 14 in eea5ee2
I think if you updated the action to pass any users with names like @org/team
as team_reviewers
instead of reviewers
it would probably work as expected.
from auto-assign-action.
@kentaro-m This is a really important feature. Can you please let us know when this feature can be expected approximately?
from auto-assign-action.
@chabroA
If you'd like to use GitHub teams to specify reviewers, you need to make a new PAT because the default GITHUB_TOKEN doesn't have the permission to request a review from a team.
The PAT needs to have the repo scope and the account the PAT belongs to needs to have the write permission to the repository.
from auto-assign-action.
Same here, is this the expected behavior? Teams are not supported as reviewers?
from auto-assign-action.
I had tested it to work with teams around March but isn't working anymore
- org/team
was the format that worked for me.
from auto-assign-action.
I don't think assigning a PR/issue to a team would be possible. You can request a team to review a PR but you cant assign the PR to a team. The assignment can be done to users only.
You can verify that by going to the Github and trying to assign a PR to a team. It doesn't allow you to.
Also, I think these API's confirm this theory:
-
This is the "pr request review" api which allow us to add
reviewers
and/orteam_reviewers
https://octokit.github.io/rest.js/v17#pulls-create-review-request -
Whereas the "assign issue" api only allows
assignees
(and not something like team_assignees)
https://octokit.github.io/rest.js/v17#issues-add-assignees
I hope I'm wrong but that's the conclusion I reached after some investigation.
from auto-assign-action.
I don't think assigning a PR/issue to a team would be possible. You can request a team to review a PR but you cant assign the PR to a team. The assignment can be done to users only.
You can verify that by going to the Github and trying to assign a PR to a team. It doesn't allow you to.
Also, I think these API's confirm this theory:
- This is the "pr request review" api which allow us to add
reviewers
and/orteam_reviewers
https://octokit.github.io/rest.js/v17#pulls-create-review-request- Whereas the "assign issue" api only allows
assignees
(and not something like team_assignees)
https://octokit.github.io/rest.js/v17#issues-add-assigneesI hope I'm wrong but that's the conclusion I reached after some investigation.
Actually that's not true at least for GitHub's Enterprise UI (not sure about API). Currently, you can assign a team as a reviewer, and also configure some rules in the settings to tell the strategy on how to spread it into a list of users (round-robin, etc).
This also works for CODEOWNERS.
from auto-assign-action.
@gmazzo Maybe there's a misunderstanding there.
I completely agree with you when you say:
Currently, you can assign a team as a reviewer,...
Actually that's exactly what I meant in my comment as well:
You can request a team to review a PR
What I said that wasn't possible has nothing to do with the "reviewers" of a PR. "Reviewers" and "Assignees" are 2 completely different features.
Please check this post for more info
Your comment and my comment are in agreement regarding the "Reviewers" feature. What I said wasn't possible was related to the "Assignee" feature.
from auto-assign-action.
@gmazzo Maybe there's a misunderstanding there.
I completely agree with you when you say:
Currently, you can assign a team as a reviewer,...
Actually that's exactly what I meant in my comment as well:
You can request a team to review a PR
What I said that wasn't possible has nothing to do with the "reviewers" of a PR. "Reviewers" and "Assignees" are 2 completely different features.
Please check this post for more infoYour comment and my comment are in agreement regarding the "Reviewers" feature. What I said wasn't possible was related to the "Assignee" feature.
You are totally right! Sorry for the confusion
from auto-assign-action.
When you try to assign a team as a reviewer
This issue is about assigning a team as a reviewer, not the assignee. And to be clear, that is what I was testing.
from auto-assign-action.
I was trying to fix this but I have no idea how to compile the lib outputs of tsc
to dist/index.js
so that I can test it. I keep getting
##[warning]Validation Failed
If anyone can help me with this, that would be great: https://github.com/tmayad/auto-assign-action
from auto-assign-action.
I've worked around this by using CODEOWNERS
and setting branch protection rule to require review from them.
from auto-assign-action.
name: 'Auto Assign'
on:
pull_request:
types: [opened, ready_for_review, reopened]
jobs:
add-reviews:
runs-on: ubuntu-latest
steps:
- uses: octokit/[email protected]
id: request_review
with:
route: POST /repos/repository-owner-name/${{ github.event.repository.name }}/pulls/${{ github.event.pull_request.number }}/requested_reviewers
team_reviewers: '["teamA"]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_BOT_TOKEN }} // use PAT instead of GITHUB_TOKEN
- run: "echo 'latest release: ${{ steps.request_review.outputs.data }}'"
from auto-assign-action.
@amondnet interesting solution indeed.
Quick question, why using a PAT instead of GITHUB_TOKEN?
from auto-assign-action.
Related Issues (20)
- Keep getting Bad_Credentials error HOT 6
- Group of reviewers per label
- `[warning]Resource not accessible by integration` when running against PRs HOT 3
- Allow overriding the default draft skip behavior
- BUG HOT 1
- Assign project? HOT 3
- fails to add reviewer & assignee
- Explain the purpose of review groups HOT 1
- Assignees enhancement - Option to include Author (ie. owner) in conjunction with other auto-assignees.
- Reviewer re-request review after approved
- Does not add a reviewer HOT 3
- Auto-assign the original author + another member
- Allow assignment on pull_request_review action
- Non English Letter skipKeywords Fail
- Why a separate yaml file for configuration?
- Action Required: Fix Renovate Configuration
- Dependency Dashboard
- [support] Error: Input required and not supplied: repo-token HOT 3
- Node.js 12 actions are deprecated HOT 2
- Can we upgrade node to v16? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from auto-assign-action.