-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
If reviewers already assigned, skip #16
Comments
@brianeclow //cc @kentaro-m You're searching for action to run only once. Usually it runs on every push on PR. So i think this will take care of it.
|
Nope! If I am understanding correctly, the code can check the reviewer array, and act accordingly. And at that point, we could get options: no action taken, add reviewers from the pool to bring up to the desired total, add reviews from the pool, etc. |
We are running into the same issue too. For example if I create a non-draft, normal PR it assigns 2 reviewers. Let's say I instantly mark that PR as draft. Now when I mark it ready for review again, it adds 2 more reviewers which is not really expected. |
Because of reviewer amount limitations in private repos in orgs this also results in unassigning the current reviewer on every push action (or in case of only updating on open and reopen on every open/reopen action). We're also running into the issue that when assigning a reviewer during creation of a PR it gets overwritten immediately by the action. |
I just managed to work around it for now by adding a condition to the job like this: name: 'Auto Assign' on: pull_request: types: [opened, reopened] jobs: add-reviews: if: github.event.pull_request.requested_reviewers.*.name == '' runs-on: ubuntu-latest steps: - uses: kentaro-m/[email protected] with: repo-token: "${{ secrets.GITHUB_TOKEN }}" |
@PrinsFrank interesting, though doesn't seem to work for me. When I submit a PR, it just skips the action all together initially 🤔 |
@PrinsFrank That does not work. I did several iterations around it, and github actions will not let you test an empty array in that fashion or in any way I could think of. This is final configuration I ended up with before stopping:
|
Hi, @brianeclow! Thanks for waiting. I thought a good idea which checking exist assignees or reviewers before adding its to PR.
I think it's better to control the skipping process as the logic of the application rather than the if syntax of the workflow. If you have any concerns, please let me know. |
This sounds good to me. To be clear, it should precisely be checking that the "number" of reviewers/assignees match what's specified in the config file. I'm having the same general problem, but specifically one no one has mentioned: I open a PR, the right number of (random) reviewers get added (good). Any subsequent commit pushed to that PR will trigger more reviewers being assigned (bad). |
My team encountered this problem. Is there any up-to-date solution? |
Hey @idonov8 I haven't tested or used this action in a long while, sorry I cannot be of help. |
Any news on this? The hack I resorted to was an additional step checking for number of already assigned reviewers, and then failing this step if there are already assigned reviewers. We also only need at least 1 reviewer, sooo 🤷
|
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.The text was updated successfully, but these errors were encountered: