Skip to content

fix(cli): one refusal walk for every leaf apply can write #3237

fix(cli): one refusal walk for every leaf apply can write

fix(cli): one refusal walk for every leaf apply can write #3237

Workflow file for this run

name: review gate
# Says whether a pull request's tip carries a reviewer PASS (`Tip SHA:` = head,
# `Ran:`, `Not run:`, `Verdict: PASS`, by a login in
# .github/agent/review-policy.json; the newest report at the tip wins), and why
# not when it does not. REPORT ONLY: continue-on-error, never labels, comments,
# approves or merges, and it is not a required check -- keep it out of the
# ruleset. AGENTS.md › Merge policy says what an agent may do with a PASS.
#
# It re-runs when a comment or review lands, so the summary follows the newest
# report. Safety: `pull_request` / `issue_comment` / `pull_request_review`
# (never pull_request_target), read-only token, no secrets. The script and the
# policy come from the BASE commit (the default branch for a comment event) and
# the PR is read only through the API; PR code is never run. The one exception
# is the pull request that introduces the script: its base has no copy yet, so
# that single run falls back to the PR's copy under the same read-only token.
on:
pull_request:
pull_request_review:
types: [submitted, edited]
issue_comment:
types: [created, edited]
concurrency:
group: review-gate-${{ github.event.pull_request.number || github.event.issue.number }}
cancel-in-progress: true
permissions:
contents: read
issues: read
pull-requests: read
jobs:
report:
name: reviewed tip (report only)
if: github.event_name != 'issue_comment' || github.event.issue.pull_request
runs-on: ubuntu-latest
timeout-minutes: 5
continue-on-error: true
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.base.sha || github.event.repository.default_branch }}
path: base
persist-credentials: false
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
if: hashFiles('base/.github/scripts/review_gate.py') == '' && github.event_name == 'pull_request'
with:
path: pr
persist-credentials: false
- name: Judge the tip
# A tip without a PASS exits 1 so by-hand use reads as a failure; the
# step is neutral here, so the check never turns red.
continue-on-error: true
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
PR: ${{ github.event.pull_request.number || github.event.issue.number }}
run: |
dir="base"
if [ ! -f base/.github/scripts/review_gate.py ]; then
if [ ! -d pr ]; then
echo "::notice::No review gate on the default branch yet."
exit 0
fi
echo "::notice::The base commit has no review gate yet; using the copy in this pull request."
dir="pr"
fi
python3 "$dir/.github/scripts/review_gate.py"