.github/workflows/health-check.yml
71 lines · 2009 bytes
1name: 🩺 Listing Health Checks
2
3on:
4 workflow_dispatch:
5 inputs:
6 category:
7 description: Just run for specific category (optional)
8 type: string
9 section:
10 description: Just run for a specific section (optional)
11 type: string
12 service:
13 description: Just run for a specific entry (optional)
14 type: string
15 schedule:
16 - cron: '0 17 * * 5' # Weekly drift check. 5PM on a Friday, in time for weekend updates
17
18permissions:
19 contents: read
20
21jobs:
22 health-check:
23 name: Health check
24 runs-on: ubuntu-latest
25 steps:
26 - uses: actions/checkout@v5
27
28 - uses: actions/setup-python@v6
29 with:
30 python-version: "3.12"
31
32 - name: Install dependencies
33 run: pip install -q -r lib/requirements.txt
34
35 - name: Run health check
36 id: check
37 continue-on-error: true
38 env:
39 GITHUB_TOKEN: ${{ github.token }}
40 CATEGORY: ${{ inputs.category }}
41 SECTION: ${{ inputs.section }}
42 SERVICE: ${{ inputs.service }}
43 run: |
44 args=()
45 [ -n "$CATEGORY" ] && args+=(--category "$CATEGORY")
46 [ -n "$SECTION" ] && args+=(--section "$SECTION")
47 [ -n "$SERVICE" ] && args+=(--service "$SERVICE")
48 python lib/review-listings.py "${args[@]}" \
49 --save-json /tmp/findings.json \
50 --save-markdown /tmp/findings.md
51
52 - name: Write summary
53 if: always()
54 run: |
55 if [ -f /tmp/findings.md ]; then
56 cat /tmp/findings.md >> "$GITHUB_STEP_SUMMARY"
57 else
58 echo "We somehow lost the /tmp/findings.md file"
59 fi
60
61 - name: Upload findings JSON
62 if: always()
63 uses: actions/upload-artifact@v6
64 with:
65 name: listing-health-findings
66 path: /tmp/findings.json
67 if-no-files-found: ignore
68
69 - name: Fail if critical issues
70 if: steps.check.outcome == 'failure'
71 run: exit 1