Update repo_health.yml
This commit is contained in:
54
.github/workflows/repo_health.yml
vendored
54
.github/workflows/repo_health.yml
vendored
@@ -33,7 +33,7 @@ on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
profile:
|
||||
description: "Which configuration profile to validate. release checks SFTP variables used by release_pipeline. scripts checks baseline script prerequisites. all runs both."
|
||||
description: "Which configuration profile to validate. release checks SFTP variables used by release_pipeline. scripts checks baseline script prerequisites. repo runs repository health only. all runs release, scripts, and repo health."
|
||||
required: true
|
||||
default: all
|
||||
type: choice
|
||||
@@ -41,6 +41,7 @@ on:
|
||||
- all
|
||||
- release
|
||||
- scripts
|
||||
- repo
|
||||
pull_request:
|
||||
paths:
|
||||
- ".github/workflows/**"
|
||||
@@ -125,14 +126,14 @@ jobs:
|
||||
|
||||
profile="${PROFILE_RAW:-all}"
|
||||
case "${profile}" in
|
||||
all|release|scripts) ;;
|
||||
all|release|scripts|repo) ;;
|
||||
*)
|
||||
echo "ERROR: Unknown profile: ${profile}" >> "${GITHUB_STEP_SUMMARY}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${profile}" = "scripts" ]; then
|
||||
if [ "${profile}" = "scripts" ] || [ "${profile}" = "repo" ]; then
|
||||
echo "Profile scripts selected. Skipping release configuration checks." >> "${GITHUB_STEP_SUMMARY}"
|
||||
exit 0
|
||||
fi
|
||||
@@ -189,7 +190,7 @@ jobs:
|
||||
sftp -oBatchMode=yes -oStrictHostKeyChecking=no -P "${port}" -i "${key_file}" "${FTP_USER}@${FTP_HOST}" <<'EOF'
|
||||
pwd
|
||||
bye
|
||||
EOF
|
||||
EOF
|
||||
|
||||
echo "SFTP connectivity check passed." >> "${GITHUB_STEP_SUMMARY}"
|
||||
|
||||
@@ -215,14 +216,14 @@ jobs:
|
||||
|
||||
profile="${PROFILE_RAW:-all}"
|
||||
case "${profile}" in
|
||||
all|release|scripts) ;;
|
||||
all|release|scripts|repo) ;;
|
||||
*)
|
||||
echo "ERROR: Unknown profile: ${profile}" >> "${GITHUB_STEP_SUMMARY}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${profile}" = "release" ]; then
|
||||
if [ "${profile}" = "release" ] || [ "${profile}" = "repo" ]; then
|
||||
echo "Profile release selected. Skipping scripts checks." >> "${GITHUB_STEP_SUMMARY}"
|
||||
exit 0
|
||||
fi
|
||||
@@ -297,24 +298,26 @@ jobs:
|
||||
command -v php >/dev/null 2>&1 && tool_status+=("php") || true
|
||||
command -v xmllint >/dev/null 2>&1 && tool_status+=("xmllint") || true
|
||||
|
||||
export MISSING_DIRS="$(printf '%s
|
||||
' "${missing_dirs[@]:-}")"
|
||||
export MISSING_FILES="$(printf '%s
|
||||
' "${missing_files[@]:-}")"
|
||||
export LEGACY_PRESENT="$(printf '%s
|
||||
' "${legacy_present[@]:-}")"
|
||||
export TOOLS="${tool_status[*]:-}"
|
||||
|
||||
export MISSING_REQUIRED="$(printf '%s
|
||||
' "${missing_required[@]:-}")"
|
||||
export MISSING_OPTIONAL="$(printf '%s
|
||||
' "${missing_optional[@]:-}")"
|
||||
export CONTENT_WARNINGS="$(printf '%s
|
||||
' "${content_warnings[@]:-}")"
|
||||
|
||||
report_json="$(python3 - <<'PY'
|
||||
import json
|
||||
import os
|
||||
profile = os.environ.get('PROFILE_RAW') or 'all'
|
||||
required = [
|
||||
required_script_dirs = [
|
||||
"scripts/fix",
|
||||
"scripts/lib",
|
||||
"scripts/release",
|
||||
"scripts/run",
|
||||
"scripts/validate",
|
||||
]
|
||||
required_script_files = [
|
||||
"scripts/validate/manifest.sh",
|
||||
"scripts/validate/xml_wellformed.sh",
|
||||
"scripts/validate/changelog.sh",
|
||||
@@ -326,7 +329,7 @@ required = [
|
||||
"scripts/validate/no_secrets.sh",
|
||||
"scripts/validate/license_headers.sh",
|
||||
]
|
||||
legacy = [
|
||||
legacy_script_files = [
|
||||
"scripts/validate_manifest.sh",
|
||||
"scripts/validate_xml_wellformed.sh",
|
||||
"scripts/validate_changelog.sh",
|
||||
@@ -338,14 +341,23 @@ legacy = [
|
||||
"scripts/validate_no_secrets.sh",
|
||||
"scripts/validate_license_headers.sh",
|
||||
]
|
||||
missing = os.environ.get('MISSING_FILES','').split('\n') if os.environ.get('MISSING_FILES') else []
|
||||
legacy_present = os.environ.get('LEGACY_PRESENT','').split('\n') if os.environ.get('LEGACY_PRESENT') else []
|
||||
missing_dirs = os.environ.get('MISSING_DIRS','').split('
|
||||
') if os.environ.get('MISSING_DIRS') else []
|
||||
missing_files = os.environ.get('MISSING_FILES','').split('
|
||||
') if os.environ.get('MISSING_FILES') else []
|
||||
legacy_present = os.environ.get('LEGACY_PRESENT','').split('
|
||||
') if os.environ.get('LEGACY_PRESENT') else []
|
||||
tools = os.environ.get('TOOLS','').split() if os.environ.get('TOOLS') else []
|
||||
out = {
|
||||
"profile": profile,
|
||||
"checked": {"script_files": required, "legacy_script_files": legacy},
|
||||
"missing_script_files": missing,
|
||||
"legacy_present": legacy_present,
|
||||
"checked": {
|
||||
"required_script_dirs": required_script_dirs,
|
||||
"required_script_files": required_script_files,
|
||||
"legacy_script_files": legacy_script_files,
|
||||
},
|
||||
"missing_dirs": [x for x in missing_dirs if x],
|
||||
"missing_files": [x for x in missing_files if x],
|
||||
"legacy_present": [x for x in legacy_present if x],
|
||||
"tools_available": tools,
|
||||
}
|
||||
print(json.dumps(out, indent=2))
|
||||
@@ -425,7 +437,7 @@ PY
|
||||
|
||||
profile="${PROFILE_RAW:-all}"
|
||||
case "${profile}" in
|
||||
all|release|scripts) ;;
|
||||
all|release|scripts|repo) ;;
|
||||
*)
|
||||
echo "ERROR: Unknown profile: ${profile}" >> "${GITHUB_STEP_SUMMARY}"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user