Day 6: Label PRs upon Approval Criteria
December 06, 2019
label-approved-pull-requests is an action created by the Pull Panda OSS team. It will check when reviews are given on a PR and when it hits a certain amount of approvals, will change the labels on the PR to indicate it is fully approved.
Example Usage
In the following example, when a PR gets at least 2 approvals, it will have the âapprovedâ label added to the PR.
on: pull_request_reviewname: Label approved pull requestsjobs:labelWhenApproved:name: Label when approvedruns-on: ubuntu-lateststeps:- name: Label when approveduses: pullreminders/label-when-approved-action@masterenv:APPROVALS: "2"GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}ADD_LABEL: "approved"REMOVE_LABEL: "awaiting%20review"
As well, it removes a âawaiting reviewâ label by using the REMOVE_LABEL
environment variable.