fix: feat: review + dev-poll skip CI gate for non-code PRs (#266)
Add diff_has_code_files() and ci_required_for_pr() helpers to ci-helpers.sh. Non-code PRs (docs/*, formulas/*, evidence/*, *.md) that have no CI results now skip the CI gate instead of being stuck forever. Applied to: - review-pr.sh: CI gate skipped for non-code PRs - review-poll.sh: CI gate skipped for non-code PRs - dev-poll.sh: CI state treated as "success" for non-code PRs in orphan, stuck-PR, and backlog merge paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
65f161951f
commit
1ab700c87a
4 changed files with 60 additions and 6 deletions
|
|
@ -186,11 +186,14 @@ while IFS= read -r line; do
|
|||
CI_STATE=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \
|
||||
"${API_BASE}/commits/${PR_SHA}/status" | jq -r '.state // "unknown"')
|
||||
|
||||
# Skip if CI is running/failed. Allow "success" or no CI configured (empty/pending with no pipelines)
|
||||
# Skip if CI is running/failed. Allow "success", no CI configured, or non-code PRs
|
||||
if ! ci_passed "$CI_STATE"; then
|
||||
log " #${PR_NUM} CI=${CI_STATE}, skip"
|
||||
SKIPPED=$((SKIPPED + 1))
|
||||
continue
|
||||
if ci_required_for_pr "$PR_NUM"; then
|
||||
log " #${PR_NUM} CI=${CI_STATE}, skip"
|
||||
SKIPPED=$((SKIPPED + 1))
|
||||
continue
|
||||
fi
|
||||
log " #${PR_NUM} CI=${CI_STATE} but no code files — proceeding"
|
||||
fi
|
||||
|
||||
# Check formal Codeberg reviews (not comment markers)
|
||||
|
|
|
|||
|
|
@ -181,8 +181,11 @@ CI_STATE=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \
|
|||
"${API_BASE}/commits/${PR_SHA}/status" | jq -r '.state // "unknown"')
|
||||
|
||||
if ! ci_passed "$CI_STATE"; then
|
||||
log "SKIP: CI=${CI_STATE}"
|
||||
exit 0
|
||||
if ci_required_for_pr "$PR_NUMBER"; then
|
||||
log "SKIP: CI=${CI_STATE}"
|
||||
exit 0
|
||||
fi
|
||||
log "CI=${CI_STATE} but PR has no code files — skipping CI gate"
|
||||
fi
|
||||
|
||||
# --- Check for existing reviews ---
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue