Skip to content

Commit 6d4ae0d

Browse files
committed
fix(ci): only add docs/ to commit, fix diff for review
1 parent 8e7044a commit 6d4ae0d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/scripts/auto-fix.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ ${BODY}" \
4343
$GEN_MODEL_ARG \
4444
--max-turns 30 --max-duration 600 || true
4545

46-
if git diff --quiet; then
46+
if git diff --quiet && git diff --cached --quiet && [ -z "$(git ls-files --others --exclude-standard docs/)" ]; then
4747
echo "No changes"
4848
cleanup_on_failure
4949
exit 0
@@ -52,7 +52,9 @@ fi
5252
# Step 2: Review loop (max 2 rounds)
5353
APPROVED=false
5454
for round in 1 2; do
55-
DIFF=$(git diff)
55+
# Stage docs changes for diff
56+
git add docs/
57+
DIFF=$(git diff --cached)
5658
[ -z "$DIFF" ] && { APPROVED=true; break; }
5759

5860
REVIEW=$(evot -p "Review this diff for issue #${NUM}: ${TITLE}
@@ -81,15 +83,17 @@ ${COMMENTS}" \
8183
done
8284

8385
# Step 3: PR
84-
git add -A
86+
git add docs/
8587
git commit -m "docs: auto-fix #${NUM}" || { cleanup_on_failure; exit 0; }
8688
git push origin "$BRANCH" --force
8789

90+
GEN_LABEL="${GENERATOR_MODEL:-default}"
91+
REV_LABEL="${REVIEWER_MODEL:-default}"
8892
STATUS=$( [ "$APPROVED" = true ] && echo "✅ Approved" || echo "⚠️ Needs human review" )
8993
gh pr create --repo "$REPO" --base "$MAIN" --head "$BRANCH" \
9094
--title "docs: auto-fix #${NUM}" \
9195
--body "Fixes #${NUM}. ${STATUS}
92-
Generated by \`${GENERATOR_MODEL}\`, reviewed by \`${REVIEWER_MODEL}\`." \
96+
Generated by \`${GEN_LABEL}\`, reviewed by \`${REV_LABEL}\`." \
9397
--label auto-fix || true
9498

9599
# Mark done

0 commit comments

Comments
 (0)