-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github workflow to check task owners
- Loading branch information
Showing
10 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Validate PR - check task owners | ||
'on': | ||
pull_request: | ||
branches: [main] | ||
jobs: | ||
check: | ||
name: Check Task OWNERS | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check task owners | ||
run: | | ||
./hack/check-task-owners.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
owners_missing=0 | ||
check_result=$(mktemp) | ||
|
||
# Check the OWNERS file is present for each task | ||
find task/ -mindepth 1 -maxdepth 1 -type d | \ | ||
while read -r task_dir; do | ||
owners_file="$task_dir/OWNERS" | ||
if [ ! -e "$owners_file" ]; then | ||
echo "error: missing owners file $owners_file" >>"$check_result" | ||
owners_missing=1 | ||
continue | ||
fi | ||
approvers=$(yq '.approvers[]' $owners_file) | ||
reviewers=$(yq '.reviwers[]' $owners_file) | ||
if [ -z "$approvers" ] && [ -z "$reviewers" ]; then | ||
echo "$task_dir/OWNERS don't have atleast 1 approver and 1 reviewer" | ||
fi | ||
done | ||
|
||
if [ -s "$check_result" ]; then | ||
cat "$check_result" | ||
echo "Please add OWNERS file with atleast 1 approver and 1 reviewer" | ||
fi | ||
|
||
# Exit with non zero error code if OWNERS file is missing | ||
if [ "$owners_missing" -eq 1 ]; then | ||
exit 1 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# See the OWNERS docs: https://go.k8s.io/owners | ||
approvers: | ||
- build-team | ||
reviewers: | ||
- build-team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# See the OWNERS docs: https://go.k8s.io/owners | ||
approvers: | ||
- build-team | ||
reviewers: | ||
- build-team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# See the OWNERS docs: https://go.k8s.io/owners | ||
approvers: | ||
- build-team | ||
reviewers: | ||
- build-team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# See the OWNERS docs: https://go.k8s.io/owners | ||
approvers: | ||
- build-team | ||
reviewers: | ||
- build-team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# See the OWNERS docs: https://go.k8s.io/owners | ||
approvers: | ||
- build-team | ||
reviewers: | ||
- build-team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# See the OWNERS docs: https://go.k8s.io/owners | ||
approvers: | ||
- build-team | ||
reviewers: | ||
- build-team |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
#See the OWNERS docs: https://go.k8s.io/owners | ||
approvers: | ||
- cgwalters | ||
reviewers: | ||
- cgwalters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# See the OWNERS docs: https://go.k8s.io/owners | ||
approvers: | ||
- build-team | ||
reviewers: | ||
- build-team |