Skip to content

Add GitHub Actions workflow for PR approval enforcement#21

Open
aleksfasting wants to merge 3 commits into
mainfrom
aleksfasting-patch-1
Open

Add GitHub Actions workflow for PR approval enforcement#21
aleksfasting wants to merge 3 commits into
mainfrom
aleksfasting-patch-1

Conversation

@aleksfasting
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/main.yml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/main.yml Outdated
Comment on lines +23 to +31
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;
}
}
Copy link

Copilot AI Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants