diff --git a/.github/workflows/check-task-owners.yaml b/.github/workflows/check-task-owners.yaml new file mode 100644 index 000000000..fe2685b20 --- /dev/null +++ b/.github/workflows/check-task-owners.yaml @@ -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 diff --git a/hack/check-task-owners.sh b/hack/check-task-owners.sh new file mode 100755 index 000000000..4c31bfe59 --- /dev/null +++ b/hack/check-task-owners.sh @@ -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 + diff --git a/task/acs-deploy-check/OWNERS b/task/acs-deploy-check/OWNERS new file mode 100644 index 000000000..d3f0ff4a7 --- /dev/null +++ b/task/acs-deploy-check/OWNERS @@ -0,0 +1,5 @@ +# See the OWNERS docs: https://go.k8s.io/owners +approvers: + - build-team +reviewers: + - build-team diff --git a/task/acs-image-check/OWNERS b/task/acs-image-check/OWNERS new file mode 100644 index 000000000..d3f0ff4a7 --- /dev/null +++ b/task/acs-image-check/OWNERS @@ -0,0 +1,5 @@ +# See the OWNERS docs: https://go.k8s.io/owners +approvers: + - build-team +reviewers: + - build-team diff --git a/task/acs-image-scan/OWNERS b/task/acs-image-scan/OWNERS new file mode 100644 index 000000000..d3f0ff4a7 --- /dev/null +++ b/task/acs-image-scan/OWNERS @@ -0,0 +1,5 @@ +# See the OWNERS docs: https://go.k8s.io/owners +approvers: + - build-team +reviewers: + - build-team diff --git a/task/buildah-remote-oci-ta/OWNERS b/task/buildah-remote-oci-ta/OWNERS new file mode 100644 index 000000000..d3f0ff4a7 --- /dev/null +++ b/task/buildah-remote-oci-ta/OWNERS @@ -0,0 +1,5 @@ +# See the OWNERS docs: https://go.k8s.io/owners +approvers: + - build-team +reviewers: + - build-team diff --git a/task/download-sbom-from-url-in-attestation/OWNERS b/task/download-sbom-from-url-in-attestation/OWNERS new file mode 100644 index 000000000..d3f0ff4a7 --- /dev/null +++ b/task/download-sbom-from-url-in-attestation/OWNERS @@ -0,0 +1,5 @@ +# See the OWNERS docs: https://go.k8s.io/owners +approvers: + - build-team +reviewers: + - build-team diff --git a/task/gather-deploy-images/OWNERS b/task/gather-deploy-images/OWNERS new file mode 100644 index 000000000..d3f0ff4a7 --- /dev/null +++ b/task/gather-deploy-images/OWNERS @@ -0,0 +1,5 @@ +# See the OWNERS docs: https://go.k8s.io/owners +approvers: + - build-team +reviewers: + - build-team diff --git a/task/rpm-ostree/OWNERS b/task/rpm-ostree/OWNERS new file mode 100644 index 000000000..9410aae19 --- /dev/null +++ b/task/rpm-ostree/OWNERS @@ -0,0 +1,6 @@ + +#See the OWNERS docs: https://go.k8s.io/owners +approvers: + - cgwalters +reviewers: + - cgwalters diff --git a/task/upload-sbom-to-trustification/OWNERS b/task/upload-sbom-to-trustification/OWNERS new file mode 100644 index 000000000..d3f0ff4a7 --- /dev/null +++ b/task/upload-sbom-to-trustification/OWNERS @@ -0,0 +1,5 @@ +# See the OWNERS docs: https://go.k8s.io/owners +approvers: + - build-team +reviewers: + - build-team