Files
oci-deal-accelerator/.gitea/workflows/kb-health.yaml
root dc4abf3774
All checks were successful
Deploy Skill to OCI / deploy (push) Successful in 24s
Install Python via apt instead of setup-python in KB health workflow
actions/setup-python@v5 fails on the arm64 Gitea runner with "version '3.12'
with architecture 'arm64' was not found" — the prebuilt Python manifest
doesn't cover this runner/arch combo. Use the system python3 from apt; the
link-check scripts don't require 3.12 specifically.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 11:00:56 -03:00

79 lines
2.4 KiB
YAML

# Weekly KB health check — validates catalog links and reports broken URLs.
# Runs Monday 8am UTC. Does NOT block deployments or affect user experience.
# If broken links found, creates a Gitea issue for manual review.
name: KB Health Check
on:
schedule:
- cron: '0 8 * * 1'
workflow_dispatch:
jobs:
check-links:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
run: |
sudo apt-get update -qq
sudo apt-get install -y python3 python3-pip
python3 --version
- name: Install dependencies
run: python3 -m pip install --user requests beautifulsoup4 pyyaml
- name: Check Architecture Center links
id: check
continue-on-error: true
run: |
python3 tools/refresh_arch_catalog.py --check-links 2>&1 | tee /tmp/link-check.txt
echo "exit_code=$?" >> $GITHUB_OUTPUT
- name: Check SKU catalog freshness
id: sku
continue-on-error: true
run: |
python3 tools/refresh_sku_catalog.py --validate 2>&1 | tee -a /tmp/link-check.txt
- name: Create issue if problems found
if: steps.check.outcome == 'failure'
run: |
BROKEN=$(grep -c "❌" /tmp/link-check.txt || echo "0")
REDIRECTED=$(grep -c "↪️" /tmp/link-check.txt || echo "0")
BODY=$(cat <<'ISSUE_EOF'
## KB Health Check — Broken Links Found
**Run date:** $(date -u +%Y-%m-%d)
**Broken:** $BROKEN URLs
**Redirected:** $REDIRECTED URLs
<details>
<summary>Full report</summary>
```
$(cat /tmp/link-check.txt)
```
</details>
### Action needed
- For 404s: remove entry or find new URL via `python tools/refresh_arch_catalog.py --whats-new`
- For redirects: update URL in `kb/architecture-center/catalog.yaml`
ISSUE_EOF
)
# Note: Gitea issue creation requires gitea CLI or API call
# For now, save report as artifact
echo "$BODY" > /tmp/kb-health-report.md
echo "::warning::$BROKEN broken links found in KB catalog"
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: kb-health-report
path: /tmp/link-check.txt
retention-days: 30