Skip to content

ci: Add Github action to add "has:owner-approval" label for approved PRs #2798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

hectorhdzg
Copy link
Member

@hectorhdzg hectorhdzg commented Apr 23, 2025

Which problem is this PR solving?

Automate label tagging for owner reviews in PRs

Short description of the changes

Added scripts to parse component_owners.yml, to get existing components and owners by componer
Added script to get details about a PR, looks for all updated files and determine if one of the owner of that file already approved the PR, then add label.
Added workflow to kick off the script when a PR is reviewed and approved.

Copy link

codecov bot commented Apr 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.74%. Comparing base (2317e2f) to head (36b8aa7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2798      +/-   ##
==========================================
+ Coverage   89.69%   89.74%   +0.04%     
==========================================
  Files         186      186              
  Lines        9048     9048              
  Branches     1855     1855              
==========================================
+ Hits         8116     8120       +4     
+ Misses        932      928       -4     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hectorhdzg hectorhdzg changed the title Add Github action to add "has:owner-approval" label for approved PRs ci: Add Github action to add "has:owner-approval" label for approved PRs Apr 23, 2025
@hectorhdzg hectorhdzg marked this pull request as ready for review May 2, 2025 21:39
@hectorhdzg hectorhdzg requested a review from a team as a code owner May 2, 2025 21:39
Copy link
Contributor

@JacksonWeber JacksonWeber left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +3 to +6
on:
pull_request_review:
types:
- submitted
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I think that the pull_request_review trigger only provides a read-only GITHUB_TOKEN - I guess it would not be able to re-label the PR in that case, right? 🤔

Thinking more about it, I'm also wondering if there are some security concerns if we were to give the workflow additional permissions. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

We can add permissions by workflow right? that would prevent us to change the default permissions and keep them read only for other workflows

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