Skip to content
Open
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
28 changes: 19 additions & 9 deletions boilerplate/openshift/golang-osd-operator/update
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,25 @@ cp ${HERE}/.codecov.yml $REPO_ROOT
echo "Copying OWNERS_ALIASES to your repository root."
cp -L ${HERE}/OWNERS_ALIASES $REPO_ROOT

# Add CICD owners to .tekton if exists
if [[ -d "${REPO_ROOT}/.tekton/" ]]; then
echo "Adding Konflux subdirectory OWNERS file to .tekton/"
cat >"${REPO_ROOT}/.tekton/OWNERS" <<EOF
reviewers:
- srep-infra-cicd
approvers:
- srep-infra-cicd
EOF
# Clean up srep-infra-cicd from .tekton/OWNERS if it exists
if [[ -f "${REPO_ROOT}/.tekton/OWNERS" ]]; then
echo "Checking .tekton/OWNERS for srep-infra-cicd cleanup..."

# Check if file contains srep-infra-cicd
if grep -q "srep-infra-cicd" "${REPO_ROOT}/.tekton/OWNERS"; then
# Count non-comment, non-blank lines excluding srep-infra-cicd
other_owners=$(grep -v "^#" "${REPO_ROOT}/.tekton/OWNERS" | grep -v "^$" | grep -v "reviewers:" | grep -v "approvers:" | grep -v "srep-infra-cicd" | wc -l)

if [[ "$other_owners" -eq 0 ]]; then
# Only srep-infra-cicd present, delete the file
echo "Removing .tekton/OWNERS (only contained srep-infra-cicd)"
rm "${REPO_ROOT}/.tekton/OWNERS"
else
# Other owners present, just remove srep-infra-cicd lines
echo "Removing srep-infra-cicd from .tekton/OWNERS (keeping other owners)"
sed -i '/srep-infra-cicd/d' "${REPO_ROOT}/.tekton/OWNERS"
fi
fi
fi

# Add dependabot configuration
Expand Down