ci-health-check.sh: replace hardcoded repos with dynamic GitHub API discovery

Use gh api --paginate to dynamically fetch all non-archived public repos
matching ^headlamp-.+ from the privilegedescalation org. This eliminates
the need to manually update the repo list when new plugins are added.

NOTE: --paginate must come before the endpoint arg, not after --jq.
The previous commit had 'gh api paginate' which is incorrect syntax.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-05-03 18:08:56 +00:00
committed by Gandalf the Greybeard [agent]
parent 73d91725a9
commit d872bdc626
+9 -9
View File
@@ -6,17 +6,17 @@ set -euo pipefail
ORG="privilegedescalation"
PLUGIN_REPOS=(
headlamp-polaris-plugin
headlamp-rook-plugin
headlamp-sealed-secrets-plugin
headlamp-intel-gpu-plugin
headlamp-tns-csi-plugin
headlamp-kube-vip-plugin
headlamp-argocd-plugin
headlamp-plugin-template
mapfile -t PLUGIN_REPOS < <(
gh api --paginate "orgs/${ORG}/repos" \
--jq '.[] | select(.archived == false and .visibility == "public") | .name' \
2>/dev/null | grep -E '^headlamp-.+' | sort
)
if [ ${#PLUGIN_REPOS[@]} -eq 0 ]; then
echo "ERROR: No repos discovered for ${ORG}" >&2
exit 1
fi
echo "=== CI/CD Health Check — $(date -u '+%Y-%m-%d %H:%M UTC') ==="
echo ""