Merge pull request 'fix: review-poll skips PRs when project has no CI' (#36) from fix/review-no-ci into main

Reviewed-on: https://codeberg.org/johba/disinto/pulls/36
This commit is contained in:
johba 2026-03-17 10:06:44 +01:00
commit cfd4619e81

View file

@ -56,10 +56,16 @@ 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)
if [ "$CI_STATE" != "success" ]; then
log " #${PR_NUM} CI=${CI_STATE}, skip"
SKIPPED=$((SKIPPED + 1))
continue
# Projects without CI (woodpecker_repo_id=0) treat empty/pending as pass
if [ "${WOODPECKER_REPO_ID:-2}" = "0" ] && [ "$CI_STATE" = "" ] || [ "$CI_STATE" = "pending" ]; then
: # no CI configured, proceed to review
else
log " #${PR_NUM} CI=${CI_STATE}, skip"
SKIPPED=$((SKIPPED + 1))
continue
fi
fi
# Check formal Codeberg reviews (not comment markers)