44 pull_request :
55 types : [opened, synchronize, ready_for_review, reopened]
66 branches :
7- - develop
7+ - main
88 - ' proj/**'
99
1010concurrency :
@@ -17,41 +17,14 @@ permissions:
1717
1818jobs :
1919 auto-review :
20- if : ${{ !github.event.pull_request.draft }}
20+ if : ${{ !github.event.pull_request.draft && github.event.pull_request.author_association == 'MEMBER' }}
2121 runs-on : ubuntu-latest
2222 timeout-minutes : 10
2323 steps :
2424 - uses : actions/checkout@v6
2525 with :
2626 fetch-depth : 1
27-
28- - name : Detect main branch sync
29- id : detect-sync
30- run : |
31- if [ "${{ github.event.action }}" != "synchronize" ]; then
32- echo "is_main_sync=false" >> "$GITHUB_OUTPUT"
33- exit 0
34- fi
35-
36- git fetch origin main --depth=1
37- MAIN_SHA=$(git rev-parse origin/main)
38- PARENTS=$(git log -1 --format='%P')
39- PARENT1=$(echo "$PARENTS" | awk '{print $1}')
40- PARENT2=$(echo "$PARENTS" | awk '{print $2}')
41-
42- BEFORE="${{ github.event.before }}"
43-
44- if [ -n "$PARENT2" ] && \
45- { { [ "$PARENT1" = "$BEFORE" ] && [ "$PARENT2" = "$MAIN_SHA" ]; } || \
46- { [ "$PARENT2" = "$BEFORE" ] && [ "$PARENT1" = "$MAIN_SHA" ]; }; }; then
47- echo "is_main_sync=true" >> "$GITHUB_OUTPUT"
48- echo "Skipping review: sync from main detected"
49- else
50- echo "is_main_sync=false" >> "$GITHUB_OUTPUT"
51- fi
52-
5327 - uses : anthropics/claude-code-action@v1
54- if : steps.detect-sync.outputs.is_main_sync != 'true'
5528 with :
5629 anthropic_api_key : ${{ secrets.ANTHROPIC_API_KEY }}
5730 github_token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments