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:
committed by
Gandalf the Greybeard [agent]
parent
73d91725a9
commit
d872bdc626
@@ -6,17 +6,17 @@ set -euo pipefail
|
|||||||
|
|
||||||
ORG="privilegedescalation"
|
ORG="privilegedescalation"
|
||||||
|
|
||||||
PLUGIN_REPOS=(
|
mapfile -t PLUGIN_REPOS < <(
|
||||||
headlamp-polaris-plugin
|
gh api --paginate "orgs/${ORG}/repos" \
|
||||||
headlamp-rook-plugin
|
--jq '.[] | select(.archived == false and .visibility == "public") | .name' \
|
||||||
headlamp-sealed-secrets-plugin
|
2>/dev/null | grep -E '^headlamp-.+' | sort
|
||||||
headlamp-intel-gpu-plugin
|
|
||||||
headlamp-tns-csi-plugin
|
|
||||||
headlamp-kube-vip-plugin
|
|
||||||
headlamp-argocd-plugin
|
|
||||||
headlamp-plugin-template
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
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 "=== CI/CD Health Check — $(date -u '+%Y-%m-%d %H:%M UTC') ==="
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user