|
14 | 14 | name: Run code review agent on every pull request, respond to user comments |
15 | 15 |
|
16 | 16 | steps: |
17 | | - - name: Set Options Environment Variable for Issue Comment |
18 | | - if: github.event_name == 'issue_comment' |
| 17 | + - name: Set Options Environment Variable |
19 | 18 | run: | |
20 | 19 | GIT_DOMAIN_OPTION="" |
21 | 20 | if [[ -n "${{ vars.GIT_DOMAIN }}" ]]; then |
|
33 | 32 | if [[ -n "${{ vars.EXCLUDE_BRANCHES }}" ]]; then |
34 | 33 | EXCLUDE_BRANCHES_OPTION=" --exclude_branches=${{ vars.EXCLUDE_BRANCHES }}" |
35 | 34 | fi |
36 | | - echo "OPTIONS=--static_analysis.fb_infer.enabled=True --code_feedback=True --dependency_check.enabled=False --bee.path=/automation-platform --bee.actn_dir=/automation-platform/default_bito_ad/bito_modules --git.access_token=${{ secrets.GIT_ACCESS_TOKEN }} --bito_cli.bito.access_key=${{ secrets.BITO_ACCESS_KEY }}${GIT_DOMAIN_OPTION}${STATIC_ANALYSIS_TOOL_OPTION}${REVIEW_SCOPE_OPTION}${EXCLUDE_BRANCHES_OPTION}" >> $GITHUB_ENV |
| 35 | + EXCLUDE_FILES_OPTION="" |
| 36 | + if [[ -n "${{ vars.EXCLUDE_FILES }}" ]]; then |
| 37 | + EXCLUDE_FILES_OPTION=" --exclude_files=${{ vars.EXCLUDE_FILES }}" |
| 38 | + fi |
| 39 | + EXCLUDE_DRAFT_PR_OPTION="" |
| 40 | + if [[ -n "${{ vars.EXCLUDE_DRAFT_PR }}" ]]; then |
| 41 | + EXCLUDE_DRAFT_PR_OPTION=" --exclude_draft_pr=${{ vars.EXCLUDE_DRAFT_PR }}" |
| 42 | + fi |
| 43 | + echo "OPTIONS=--static_analysis.fb_infer.enabled=True --code_feedback=True --dependency_check.enabled=False --bee.path=/automation-platform --bee.actn_dir=/automation-platform/default_bito_ad/bito_modules --git.access_token=${{ secrets.GIT_ACCESS_TOKEN }} --bito_cli.bito.access_key=${{ secrets.BITO_ACCESS_KEY }}${GIT_DOMAIN_OPTION}${STATIC_ANALYSIS_TOOL_OPTION}${REVIEW_SCOPE_OPTION}${EXCLUDE_BRANCHES_OPTION}${EXCLUDE_FILES_OPTION}${EXCLUDE_DRAFT_PR_OPTION}" >> $GITHUB_ENV |
| 44 | +
|
37 | 45 | - name: Code Review Agent - Issue Comment |
38 | 46 | if: github.event_name == 'issue_comment' |
39 | 47 | uses: gitbito/codereviewagent@main |
|
42 | 50 | command: ${{ github.event.comment.body }} |
43 | 51 | options: ${{ env.OPTIONS }} |
44 | 52 |
|
45 | | - - name: Set Options Environment Variable for Pull Request |
46 | | - if: github.event_name == 'pull_request' |
47 | | - run: | |
48 | | - GIT_DOMAIN_OPTION="" |
49 | | - if [[ -n "${{ vars.GIT_DOMAIN }}" ]]; then |
50 | | - GIT_DOMAIN_OPTION=" --git.domain=${{ vars.GIT_DOMAIN }}" |
51 | | - fi |
52 | | - STATIC_ANALYSIS_TOOL_OPTION="" |
53 | | - if [[ -n "${{ vars.STATIC_ANALYSIS_TOOL }}" ]]; then |
54 | | - STATIC_ANALYSIS_TOOL_OPTION=" --static_analysis_tool=${{ vars.STATIC_ANALYSIS_TOOL }}" |
55 | | - fi |
56 | | - REVIEW_SCOPE_OPTION="" |
57 | | - if [[ -n "${{ vars.REVIEW_SCOPE }}" ]]; then |
58 | | - REVIEW_SCOPE_OPTION=" --review_scope=${{ vars.REVIEW_SCOPE }}" |
59 | | - fi |
60 | | - EXCLUDE_BRANCHES_OPTION="" |
61 | | - if [[ -n "${{ vars.EXCLUDE_BRANCHES }}" ]]; then |
62 | | - EXCLUDE_BRANCHES_OPTION=" --exclude_branches=${{ vars.EXCLUDE_BRANCHES }}" |
63 | | - fi |
64 | | - echo "OPTIONS=--static_analysis.fb_infer.enabled=True --code_feedback=True --dependency_check.enabled=False --bee.path=/automation-platform --bee.actn_dir=/automation-platform/default_bito_ad/bito_modules --git.access_token=${{ secrets.GIT_ACCESS_TOKEN }} --bito_cli.bito.access_key=${{ secrets.BITO_ACCESS_KEY }}${GIT_DOMAIN_OPTION}${STATIC_ANALYSIS_TOOL_OPTION}${REVIEW_SCOPE_OPTION}${EXCLUDE_BRANCHES_OPTION}" >> $GITHUB_ENV |
65 | 53 | - name: Code Review Agent action step |
66 | 54 | if: github.event_name == 'pull_request' |
67 | 55 | uses: gitbito/codereviewagent@main |
|
0 commit comments