Skip to content

Pipeline liveness

Pipeline liveness #1

name: Pipeline liveness
# Weekly check that community reports are being consumed and that upstream
# sources with a timetable are still being imported. A failure opens one issue
# labelled pipeline-stalled, later failures comment on it, and the first passing
# run closes it. The queue is expected to go stale between drains, so this lives
# apart from the push workflow instead of turning it permanently red.
on:
schedule:
- cron: "17 6 * * 1"
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
liveness:
name: Report queue and source freshness
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Check out source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.13"
- name: Run the liveness checks
id: check
run: |
set +e
python scripts/pipeline_liveness.py --scheduled > liveness.txt 2>&1
echo "status=$?" >> "$GITHUB_OUTPUT"
cat liveness.txt
- name: Open or update the tracking issue
if: steps.check.outputs.status != '0'
env:
GH_TOKEN: ${{ github.token }}
run: |
body="$(printf 'The weekly pipeline check failed on %s.\n\n```\n%s\n```\n' "$(date -u +%Y-%m-%d)" "$(cat liveness.txt)")"
number="$(gh issue list --state open --label pipeline-stalled --json number --jq '.[0].number // empty')"
if [ -n "$number" ]; then
gh issue comment "$number" --body "$body"
else
gh label create pipeline-stalled --color B60205 --description "The weekly pipeline check is failing" 2>/dev/null || true
gh issue create --title "Report pipeline is stalled" --label pipeline-stalled --body "$body"
fi
exit 1
- name: Close the tracking issue once healthy
if: steps.check.outputs.status == '0'
env:
GH_TOKEN: ${{ github.token }}
run: |
for number in $(gh issue list --state open --label pipeline-stalled --json number --jq '.[].number'); do
gh issue close "$number" --comment "The weekly pipeline check passed on $(date -u +%Y-%m-%d)."
done