Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
56 changes: 56 additions & 0 deletions .github/workflows/codeowners-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CODEOWNERS Validation
run-name: ${{ github.actor }} is checking each Dockerfile for a CODEOWNER
on:
pull_request:
branches:
- main

jobs:
CheckDockerfileCodeowners:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Check each Dockerfile for a CODEOWNER
run: |
#!/bin/bash
set -e
codeOwnersFilePath="CODEOWNERS"
codeOwnerPaths=()
# Read and parse the CODEOWNERS file
while IFS= read -r line; do
if [[ "$line" =~ ^\s*# ]] || [[ -z "$line" ]] || [[ "$line" =~ ^[[:space:]]*$ ]]; then
continue
fi
path=$(echo "$line" | cut -d' ' -f1 | sed 's/^[[:space:]]*//' | sed 's/[\/&]/\\&/g' | sed 's/\./\\./g' | sed 's/\*/.*/g')
codeOwnerPaths+=("$path")
done < "$codeOwnersFilePath"
filesWithoutOwner=()
dockerfiles=$(find . -type f -name "Dockerfile")
# Check each Dockerfile for an owner
for dockerfile in $dockerfiles; do
ownerFound=false
for path in "${codeOwnerPaths[@]}"; do
if [[ "$dockerfile" =~ $path ]]; then
ownerFound=true
break
fi
done
if [[ "$ownerFound" == false ]]; then
filesWithoutOwner+=("$dockerfile")
fi
done
# Fail the build if there are files without an owner
if [[ ${#filesWithoutOwner[@]} -gt 0 ]]; then
echo "The following Dockerfiles do not have an owner in the CODEOWNERS file:"
printf "%s\n" "${filesWithoutOwner[@]}"
exit 1
fi
72 changes: 71 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,74 @@
# Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths.
# See https://help.github.com/articles/about-code-owners/

* @dotnet/dotnet-docker-reviewers
### General infra ###
/* @dotnet/dotnet-docker-reviewers
eng/ @dotnet/dotnet-docker-reviewers

### Dockerfiles ###

# almalinux
src/almalinux/**/source-build/ @dotnet/source-build-internal
src/almalinux/**/helix/ @dotnet/dnceng

# alpine
src/alpine/**/helix/ @dotnet/dnceng
src/alpine/**/amd64/ @dotnet/dotnet-source-build-internal

# azurelinux
src/azurelinux/**/cross*/ @dotnet/runtime-infrastructure
src/azurelinux/**/android/ @dotnet/runtime-infrastructure
src/azurelinux/**/fpm/ @dotnet/runtime-infrastructure
src/azurelinux/**/opt/ @dotnet/runtime-infrastructure
src/azurelinux/**/webassembly/ @dotnet/runtime-infrastructure

# cbl-mariner
src/cbl-mariner/**/cross*/ @dotnet/runtime-infrastructure
src/cbl-mariner/**/android/ @dotnet/runtime-infrastructure
src/cbl-mariner/**/fpm/ @dotnet/runtime-infrastructure
src/cbl-mariner/**/opt/ @dotnet/runtime-infrastructure
src/cbl-mariner/**/webassembly/ @dotnet/runtime-infrastructure
src/cbl-mariner/**/docker-testrunner/ @lbussell @mthalman @dotnet/dotnet-docker-reviewers
src/cbl-mariner/2.0/amd64/ @dotnet/runtime-infrastructure
src/cbl-mariner/2.0/helix/ @dotnet/dnceng

# centos
src/centos/stream9/amd64/ @dotnet/source-build-internal
src/centos/stream9/helix/ @dotnet/dnceng
src/centos/stream9/mlnet/helix/ @dotnet/dnceng

# debian
src/debian/11/amd64/ @dotnet/source-build-internal
src/debian/11/arm64v8/ @dotnet/source-build-internal
src/debian/**/helix/ @dotnet/dnceng
src/debian/11/opt/arm64v8/ @dotnet/runtime-infrastructure
src/debian/12/gcc14/amd64/ @dotnet/runtime-infrastructure

# fedora
src/fedora/**/amd64/ @dotnet/source-build-internal

# nanoserver
src/nanoserver/1809/helix/amd64/ @dotnet/dnceng

# opensuse
src/opensuse/15.4/helix/amd64/ @dotnet/dnceng

# raspbian
src/raspbian/10/crossdeps/arm32v7/ @dotnet/runtime-infrastructure
src/raspbian/10/helix/arm32v6/ @dotnet/dnceng

# ubuntu
src/ubuntu/**/helix/ @dotnet/dnceng
src/ubuntu/**/cross*/ @dotnet/runtime-infrastructure
src/ubuntu/**/debpkg/ @dotnet/runtime-infrastructure
src/ubuntu/**/webassembly*/ @dotnet/runtime-infrastructure
src/ubuntu/22.04/mlnet/ @dotnet/runtime-infrastructure
src/ubuntu/22.04/opt/arm64v8/ @dotnet/runtime-infrastructure
src/ubuntu/common/coredeps/ @dotnet/runtime-infrastructure
src/ubuntu/20.04/Dockerfile @dotnet/source-build-internal
src/ubuntu/22.04/Dockerfile @dotnet/source-build-internal
src/ubuntu/24.04/Dockerfile @dotnet/source-build-internal

# windowsservercore
src/windowsservercore/**/helix/ @dotnet/runtime-infrastructure
src/windowsservercore/**/webassembly/ @dotnet/runtime-infrastructure