Skip to content

Commit 94b692a

Browse files
Refactor: Expand PR approval to include child teams
Co-authored-by: dustin <[email protected]>
1 parent c154849 commit 94b692a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This directory contains GitHub Actions workflows for the TruffleHog repository.
44

55
## PR Approval Check (`pr-approval-check.yml`)
66

7-
This workflow enforces that at least one PR approver must be a member of the `@trufflesecurity/product-eng` team.
7+
This workflow enforces that at least one PR approver must be a member of the `@trufflesecurity/product-eng` team or any of its child teams.
88

99
### How it works:
1010

@@ -15,12 +15,13 @@ This workflow enforces that at least one PR approver must be a member of the `@t
1515
2. **Approval Check**: The workflow:
1616
- Fetches all reviews for the PR
1717
- Filters for approved reviews
18-
- Checks if any approver is an active member of `@trufflesecurity/product-eng`
18+
- Gets all child teams of `@trufflesecurity/product-eng`
19+
- Checks if any approver is an active member of the parent team or any child team
1920
- Sets a commit status accordingly
2021

2122
3. **Status Check**: Creates a commit status named `product-eng-approval` with:
22-
-**Success**: When at least one approver is a `@trufflesecurity/product-eng` member
23-
-**Failure**: When no `@trufflesecurity/product-eng` members have approved
23+
-**Success**: When at least one approver is a `@trufflesecurity/product-eng` or child team member
24+
-**Failure**: When no `@trufflesecurity/product-eng` or child team members have approved
2425
-**Pending**: When waiting for reviews
2526

2627
### Branch Protection
@@ -39,4 +40,4 @@ The workflow uses the default `GITHUB_TOKEN` which has sufficient permissions to
3940
- Check team membership (for public teams)
4041
- Create commit statuses
4142

42-
**Note**: If the `product-eng` team is private, you may need to use a personal access token with appropriate permissions.
43+
**Note**: If the `product-eng` team or its child teams are private, you may need to use a personal access token with appropriate permissions.

0 commit comments

Comments
 (0)