abinoda / label-when-approved-action

GitHub Action that labels approved pull requests
MIT License
191 stars 130 forks source link

Label when *all* reviewers have approved #10

Open hugovk opened 4 years ago

hugovk commented 4 years ago

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:

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!