label-when-approved-action icon indicating copy to clipboard operation
label-when-approved-action copied to clipboard

Label when *all* reviewers have approved

Open hugovk opened this issue 5 years ago • 0 comments

On our project, when an author creates a PR, they choose how many people to review their PR. It's usually 2 people, but sometimes 1, sometimes up to 6.

Rather than labelling when a fixed number have approved (eg. APPROVALS: "2"), would it be possible to label once all the current PR's reviewers have reviewed?

For example:

  • if a PR has 2 reviewers, label when both have reviewed
  • if a PR has 4 reviewers, label when all 4 have reviewed
  • if a PR has 8 reviewers, label when all 8 have reviewed

Perhaps allow something like APPROVALS: "all" in the workflow .yml, and then something like this (pseudocode):

if [[ "$APPROVALS" == "all" ]]; then
    $APPROVALS = length($reviews)
fi

and do it somewhere before this:

https://github.com/pullreminders/label-when-approved-action/blob/d8e895923241c6399899471c5eb91fc3cc717776/entrypoint.sh#L53-L55

Thank you!

hugovk avatar Oct 07 '19 12:10 hugovk