Skip to content
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

STONEBLD-2649: add github action workflow to check task owners #1295

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/check-task-owners.yaml
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
25 changes: 25 additions & 0 deletions hack/check-task-owners.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

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"
continue
fi
approvers=$(yq '.approvers[]' $owners_file)
reviewers=$(yq '.reviwers[]' $owners_file)
if [ -z "$approvers" ] && [ -z "$reviewers" ]; then
echo "error: $task_dir/OWNERS don't have atleast 1 approver and 1 reviewer" >>"$check_result"
fi
done

if [ -s "$check_result" ]; then
cat "$check_result"
echo "Please add OWNERS file with atleast 1 approver and 1 reviewer"
exit 1
fi

5 changes: 5 additions & 0 deletions task/acs-deploy-check/OWNERS
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
5 changes: 5 additions & 0 deletions task/acs-image-check/OWNERS
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
5 changes: 5 additions & 0 deletions task/acs-image-scan/OWNERS
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
5 changes: 5 additions & 0 deletions task/buildah-remote-oci-ta/OWNERS
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
5 changes: 5 additions & 0 deletions task/download-sbom-from-url-in-attestation/OWNERS
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
5 changes: 5 additions & 0 deletions task/gather-deploy-images/OWNERS
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
6 changes: 6 additions & 0 deletions task/rpm-ostree/OWNERS
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
5 changes: 5 additions & 0 deletions task/upload-sbom-to-trustification/OWNERS
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
Loading