Skip to content

Instantly share code, notes, and snippets.

@KyMidd

KyMidd/asdf.sh Secret

Created February 19, 2023 18:07
Show Gist options
  • Save KyMidd/7d9f13860a6dd88e7d0b2c1b0424c8df to your computer and use it in GitHub Desktop.
Save KyMidd/7d9f13860a6dd88e7d0b2c1b0424c8df to your computer and use it in GitHub Desktop.
if [[ $GH_REPO_NAME == *"database"* ]]; then
# CODEOWNERS should contain all 4 leads groups for this project
CODEOWNERS="@$GH_ORG/${SERVICES_LEADS_TEAM_SLUG} @$GH_ORG/${TEST_LEADS_TEAM_SLUG} @$GH_ORG/${UI_LEADS_TEAM_SLUG} @$GH_ORG/${DATA_LEADS_TEAM_SLUG}"
#echo "database"
# If endpoint, api, or apiendpoint ends repo name
elif [[ $GH_REPO_NAME == *"endpoint" ]] || [[ $GH_REPO_NAME == *"api" ]] || [[ $GH_REPO_NAME == *"apiendpoint" ]]; then
# CODEOWNERS should contain ServiceLeads, UILeads, TestLeads (but not DataLeads)
CODEOWNERS="@$GH_ORG/${SERVICES_LEADS_TEAM_SLUG} @$GH_ORG/${TEST_LEADS_TEAM_SLUG} @$GH_ORG/${UI_LEADS_TEAM_SLUG}"
#echo "api/endpoint"
# All others assumed that ServicesLeads are owners
else
# CODEOWNERS should contain ServicesLeads only
CODEOWNERS="@$GH_ORG/${SERVICES_LEADS_TEAM_SLUG}"
#echo "services owned"
fi
# Sed in CODEOWNERS var to file
sed -i '' "s#PF_CODEOWNER#$CODEOWNERS#g" CODEOWNERS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment