Add GitHub Actions workflow for PR approval enforcement#21
Add GitHub Actions workflow for PR approval enforcement#21aleksfasting wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds a GitHub Actions workflow to enforce that pull requests targeting the main branch must have at least one approval before merging.
- Introduces automated PR approval enforcement using GitHub Actions
- Configures the workflow to run on pull requests to the main branch
- Implements approval checking logic using the GitHub API
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| for (const review of reviews) { | ||
| const userId = review.user.id; | ||
| if ( | ||
| !latestReviews[userId] || | ||
| new Date(review.submitted_at) > new Date(latestReviews[userId].submitted_at) | ||
| ) { | ||
| latestReviews[userId] = review; | ||
| } | ||
| } |
There was a problem hiding this comment.
The reviews array may not be sorted chronologically, which could lead to incorrect identification of the latest review. The GitHub API returns reviews in the order they were created, but iterating without sorting could miss edge cases where reviews are processed out of order.
No description provided.