Last active
August 14, 2018 00:02
-
-
Save spiffxp/c250d281330bbaea6f634ff3dc65efea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
name=$(basename ${0%.*}) | |
data_dir=data/${name} | |
mkdir -p ${data_dir} | |
sigs_yaml=${data_dir}/sigs.yaml | |
refresh_sigs_yaml=false | |
refresh_repos=false | |
refresh_root_owners=false | |
if ${refresh_sigs_yaml}; then | |
curl -s https://raw.githubusercontent.com/kubernetes/community/master/sigs.yaml > "${sigs_yaml}" | |
fi | |
sigs=$(<${sigs_yaml} yq -r '.sigs[].dir') | |
orgs="kubernetes kubernetes-sigs kubernetes-incubator kubernetes-client kubernetes-csi" | |
echo "| org/repo | in sigs.yaml? | has owners? |" | |
echo "| -------- | ------------- | ----------- |" | |
for org in ${orgs}; do | |
repos_json=${data_dir}/${org}-repos.json | |
if ${refresh_repos}; then | |
curl -sH "Authorization: token ${GITHUB_TOKEN}" \ | |
"https://api.github.com/orgs/${org}/repos?per_page=100" > ${repos_json} | |
fi | |
org_repos=$(<${repos_json} jq -r .[].full_name) | |
for org_repo in ${org_repos}; do | |
repo_dir=${data_dir}/${org_repo} | |
mkdir -p ${repo_dir} | |
root_owners=${repo_dir}/OWNERS | |
if ${refresh_root_owners}; then | |
curl -s https://raw.githubusercontent.com/${org_repo}/master/OWNERS > ${root_owners} | |
fi | |
echo -n "| [${org_repo}](https://github.com/${org_repo}) | " | |
grep -q ${org_repo} ${sigs_yaml} || echo -n "missing"; echo -n " | " | |
grep -q "404: Not Found" ${root_owners} && echo -n "no owners"; echo -n " | " | |
echo | |
done | |
# sort by sigs, owners, name | |
done | sort -r -t '|' -k 3 -k 4 -k 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment