[GitAction] Fix Duplicate Approvals
authorDongHak Park <donghak.park@samsung.com>
Mon, 3 Apr 2023 04:59:10 +0000 (13:59 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Tue, 4 Apr 2023 11:50:13 +0000 (20:50 +0900)
commit684bfcdfb3861c9fc4beba1c22a8e54c16053230
tree7fbeaa86be24dd00d1d73b79a21e547da1f89e0f
parent3a8e18c42b3dae866d94f3b5a454b33dff14b4dd
[GitAction] Fix Duplicate Approvals

Fix Duplicate Approval
- now git action count all approval
- For example someone Approve PR --> Update PR --> Approve Again then they count 2
- For example CI Approve PR every time they success then gitaction count them all

The given Git Action code performs the following tasks
1. Uses the curl command to call the GitHub REST API and retrieve a list of reviews for the given pull request in the repository.
2. Uses the jq command to filter the reviews based on whether their state is "APPROVED".
3. Extracts the login names of the users who wrote each of the filtered reviews.
4. Uses the unique function to filter out only the unique login names, removing any duplicates.
5. Calculates the length of the resulting list of unique login names, giving the count of unique users who have approved the pull request.

Therefore, this code removes any duplicate approvals, counting each unique user only once, even if they have approved more than once.

Signed-off-by: DongHak Park <donghak.park@samsung.com>
.github/workflows/Upload.yml