From d872bdc626dff02ed2bfb76203dad7905e7930a5 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Sun, 3 May 2026 18:08:56 +0000 Subject: [PATCH] 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 --- .github/scripts/ci-health-check.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/scripts/ci-health-check.sh b/.github/scripts/ci-health-check.sh index 3b003d4..40ceef5 100755 --- a/.github/scripts/ci-health-check.sh +++ b/.github/scripts/ci-health-check.sh @@ -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 ""