Skip to content

Commit 7383cd8

Browse files
lesnik512claude
andcommitted
ci: add weekly scheduled dependency check
Runs the existing _checks reusable workflow on a Monday 06:00 UTC cron (plus manual dispatch). On a scheduled failure, opens or updates a single 'scheduled-failure' tracking issue. Mirrors the pattern already in modern-di and faststream-outbox. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1459be8 commit 7383cd8

2 files changed

Lines changed: 55 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
LABEL="scheduled-failure"
5+
TITLE="Scheduled dependency check failed"
6+
7+
# Ensure the label exists. --force makes this idempotent: creates if absent,
8+
# updates color/description without error if present.
9+
gh label create "$LABEL" \
10+
--color "FBCA04" \
11+
--description "Weekly dependency check failures" \
12+
--force
13+
14+
# Find an open issue with our label, if any. --jq '.[0].number // empty'
15+
# yields the first number or an empty string when there are no matches.
16+
existing=$(gh issue list --label "$LABEL" --state open --json number --jq '.[0].number // empty')
17+
18+
if [ -z "$existing" ]; then
19+
body=$(printf '%s\n\n%s\n\n%s\n\n%s' \
20+
"The weekly scheduled dependency check failed." \
21+
"First failing run: ${RUN_URL}" \
22+
"Likely cause: a transitive dev or lint dependency (ruff, ty, eof-fixer, pytest, typing-extensions) released a breaking change. Reproduce locally with \`just install\` then \`just lint\` and \`just test\`." \
23+
"Close this issue once fixed. The next scheduled failure will open a fresh issue.")
24+
gh issue create --title "$TITLE" --label "$LABEL" --body "$body"
25+
else
26+
gh issue comment "$existing" --body "Failed again: ${RUN_URL}"
27+
fi

.github/workflows/scheduled.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: scheduled-dep-check
2+
on:
3+
schedule:
4+
- cron: "0 6 * * 1" # Mondays 06:00 UTC
5+
workflow_dispatch: {}
6+
7+
concurrency:
8+
group: scheduled-dep-check
9+
cancel-in-progress: false
10+
11+
jobs:
12+
checks:
13+
uses: ./.github/workflows/_checks.yml
14+
15+
report-failure:
16+
needs: checks
17+
if: failure() && github.event_name == 'schedule'
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
issues: write
22+
steps:
23+
- uses: actions/checkout@v6
24+
- name: Open or update tracking issue
25+
env:
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
28+
run: bash .github/scripts/report-scheduled-failure.sh

0 commit comments

Comments
 (0)