diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76d8301..921e9b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,12 @@ on: push: branches: [main] pull_request: + # Re-verify main once a week. Checking only on push means a floating tool can + # break main and the badge stays green until someone happens to commit: ruff 0.16 + # widened its default rules and main went red with no commit involved. + schedule: + - cron: "0 6 * * 1" # Mondays at 06:00 UTC + workflow_dispatch: jobs: test: diff --git a/.github/workflows/codex-review-gate.yml b/.github/workflows/codex-review-gate.yml deleted file mode 100644 index a518944..0000000 --- a/.github/workflows/codex-review-gate.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: codex-review-gate - -# Blocks a PR while the Codex reviewer has unresolved review threads on the -# CURRENT diff. It does NOT require Codex to have reviewed (that belongs in -# branch protection): with zero open threads the job is green, so a PR Codex has -# not touched still passes. -# -# - Re-runs on review, comment, and thread resolve/unresolve events, so the gate -# clears as soon as a thread is resolved and re-fires if one is reopened. -# - Outdated threads (their line changed in a newer push) are ignored: each push -# re-baselines the review, and Codex posts fresh threads if an issue remains. -# - If a PR has more than 100 threads the gate fails closed and asks for a manual -# review rather than risk passing on an unread page. -# - Resilient when there is no PR context or the API query returns nothing (Codex -# disconnected / at quota): the gate passes rather than false-failing on an empty -# value (#18). The actual app reconnection after the repo rename is a GitHub App -# settings step, done out of band. -# -# A reaction is not a resolution signal; resolve the thread to clear the gate. - -on: - pull_request: - pull_request_review: - pull_request_review_comment: - pull_request_review_thread: - -permissions: - pull-requests: read - -jobs: - gate: - runs-on: ubuntu-latest - steps: - - name: Fail on unresolved Codex review threads (current diff) - env: - GH_TOKEN: ${{ github.token }} - OWNER: ${{ github.repository_owner }} - REPO: ${{ github.event.repository.name }} - PR: ${{ github.event.pull_request.number }} - run: | - if [ -z "$PR" ]; then - echo "No pull-request context on this event; nothing to gate." - exit 0 - fi - n=$(gh api graphql -f query='query($o:String!,$r:String!,$p:Int!){repository(owner:$o,name:$r){pullRequest(number:$p){reviewThreads(first:100){nodes{isResolved isOutdated comments(first:1){nodes{author{login}}}}}}}}' -F o="$OWNER" -F r="$REPO" -F p="$PR" --jq '[.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false and .isOutdated == false) | select(.comments.nodes[0].author.login | startswith("chatgpt-codex"))] | length' 2>/dev/null || echo 0) - n=${n:-0} - echo "Open Codex review threads on the current diff: $n" - if [ "$n" -ne 0 ]; then - echo "::error::$n unresolved Codex review thread(s) on the current diff. Resolve them before merging." - exit 1 - fi