diff --git a/.github/scripts/report-scheduled-failure.sh b/.github/scripts/report-scheduled-failure.sh deleted file mode 100755 index 1a0f5f7..0000000 --- a/.github/scripts/report-scheduled-failure.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -LABEL="scheduled-failure" -TITLE="Scheduled dependency check failed" - -# Ensure the label exists. --force makes this idempotent: creates if absent, -# updates color/description without error if present. -gh label create "$LABEL" \ - --color "FBCA04" \ - --description "Scheduled dependency check failures" \ - --force - -# Find an open issue with our label, if any. --jq '.[0].number // empty' -# yields the first number or an empty string when there are no matches. -existing=$(gh issue list --label "$LABEL" --state open --json number --jq '.[0].number // empty') - -if [ -z "$existing" ]; then - body=$(printf '%s\n\n%s\n\n%s\n\n%s' \ - "The scheduled dependency check failed." \ - "First failing run: ${RUN_URL}" \ - "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\`." \ - "Close this issue once fixed. The next scheduled failure will open a fresh issue.") - gh issue create --title "$TITLE" --label "$LABEL" --body "$body" -else - gh issue comment "$existing" --body "Failed again: ${RUN_URL}" -fi diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index c7a7001..a26df52 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -15,14 +15,6 @@ jobs: report-failure: needs: checks if: failure() && github.event_name == 'schedule' - runs-on: ubuntu-latest permissions: - contents: read issues: write - steps: - - uses: actions/checkout@v6 - - name: Open or update tracking issue - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} - run: bash .github/scripts/report-scheduled-failure.sh + uses: modern-python/.github/.github/workflows/report-scheduled-failure.yml@main