-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow teams to be auto-assigned #12
Comments
Same here, is this the expected behavior? Teams are not supported as reviewers? |
A couple of weeks ago, I went and tested every permutation I could thing of for this:
None of these appeared to work. |
I had tested it to work with teams around March but isn't working anymore 😞 . |
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.
I 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). |
@gmazzo Maybe there's a misunderstanding there. I completely agree with you when you say:
Actually that's exactly what I meant in my comment as well:
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. Your 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 |
This issue is about assigning a team as a reviewer, not the assignee. And to be clear, that is what I was testing. |
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 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 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 |
I was trying to fix this but I have no idea how to compile the lib outputs of
If anyone can help me with this, that would be great: https://github.com/tmayad/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
@TMaYaD Do the package scripts https://github.com/kentaro-m/auto-assign-action/blob/master/package.json#L10-L16 |
@kentaro-m This is a really important feature. Can you please let us know when this feature can be expected approximately? |
+1 need possibility to assign team as reviewer |
I've worked around this by using |
name: 'Auto Assign'
on:
pull_request:
types: [opened, ready_for_review, reopened]
jobs:
add-reviews:
runs-on: ubuntu-latest
steps:
- uses: octokit/request-action@v2.1.7
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 }}'" |
@amondnet interesting solution indeed. Quick question, why using a PAT instead of GITHUB_TOKEN? |
@chabroA The PAT needs to have the repo scope and the account the PAT belongs to needs to have the write permission to the repository. |
@amondnet you still shouldn't use a PAT. Use the new Github Permissions system to add more permissions to the generated Add this snippet to your workflow and I expect it to work: permissions:
issues: write
pull-requests: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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.
The text was updated successfully, but these errors were encountered: