Skip to content

Commit ff8284f

Browse files
Update test_cra.yml
1 parent 544a37a commit ff8284f

1 file changed

Lines changed: 11 additions & 23 deletions

File tree

.github/workflows/test_cra.yml

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ jobs:
1414
name: Run code review agent on every pull request, respond to user comments
1515

1616
steps:
17-
- name: Set Options Environment Variable for Issue Comment
18-
if: github.event_name == 'issue_comment'
17+
- name: Set Options Environment Variable
1918
run: |
2019
GIT_DOMAIN_OPTION=""
2120
if [[ -n "${{ vars.GIT_DOMAIN }}" ]]; then
@@ -33,7 +32,16 @@ jobs:
3332
if [[ -n "${{ vars.EXCLUDE_BRANCHES }}" ]]; then
3433
EXCLUDE_BRANCHES_OPTION=" --exclude_branches=${{ vars.EXCLUDE_BRANCHES }}"
3534
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+
3745
- name: Code Review Agent - Issue Comment
3846
if: github.event_name == 'issue_comment'
3947
uses: gitbito/codereviewagent@main
@@ -42,26 +50,6 @@ jobs:
4250
command: ${{ github.event.comment.body }}
4351
options: ${{ env.OPTIONS }}
4452

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
6553
- name: Code Review Agent action step
6654
if: github.event_name == 'pull_request'
6755
uses: gitbito/codereviewagent@main

0 commit comments

Comments
 (0)