From 73ebdf649aabe1e3bdc0f70f629f7bab1876e1ba Mon Sep 17 00:00:00 2001 From: Alexey Efimchik Date: Tue, 31 Mar 2026 17:20:11 +0700 Subject: [PATCH] Updated parameter resolution --- action.yml | 52 +++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/action.yml b/action.yml index 2a22ae8..8c5ee6b 100644 --- a/action.yml +++ b/action.yml @@ -104,29 +104,35 @@ runs: - name: Run Code Review if: steps.check.outputs.run == 'true' shell: bash - env: - CC_BASE_URL: ${{ inputs.cc_base_url || env.CC_BASE_URL }} - CC_API_KEY: ${{ inputs.anthropic_api_key || env.CC_API_KEY }} - CC_MODEL: ${{ inputs.model || env.CC_MODEL }} - CC_BGMODEL: ${{ inputs.cc_bgmodel || env.CC_BGMODEL }} - CC_METRIC_URL: ${{ inputs.cc_metric_url || env.CC_METRIC_URL }} - VCS_ACCESS_TOKEN: ${{ inputs.gitea_token || env.VCS_ACCESS_TOKEN }} - TEAM_NAME: ${{ inputs.team_name || env.TEAM_NAME || github.repository_owner }} - SERVER: ${{ inputs.server || env.SERVER }} - ENABLE_REVIEWER_VERIFICATION: ${{ inputs.enable_reviewer_verification || env.ENABLE_REVIEWER_VERIFICATION }} - LOG_LEVEL: ${{ inputs.log_level || env.LOG_LEVEL }} - OPTIONS_TYPE: ${{ inputs.options_type || env.OPTIONS_TYPE }} - CC_PROMPT: ${{ inputs.cc_prompt || env.CC_PROMPT }} - CC_ALLOWED_TOOL: ${{ inputs.cc_allowed_tool || env.CC_ALLOWED_TOOL }} - CC_DISALLOWED_TOOL: ${{ inputs.cc_disallowed_tool || env.CC_DISALLOWED_TOOL }} - REPO_OWNER: ${{ inputs.repo_owner || env.REPO_OWNER }} - REPO_SLUG: ${{ inputs.repo_slug || env.REPO_SLUG }} - SOURCE_BRANCH: ${{ inputs.source_branch || env.SOURCE_BRANCH }} - SOURCE_COMMIT: ${{ inputs.source_commit || env.SOURCE_COMMIT }} - PR_ID: ${{ inputs.pr_id || env.PR_ID }} - PR_DESTINATION_BRANCH: ${{ inputs.pr_destination_branch || env.PR_DESTINATION_BRANCH }} - PR_DESTINATION_COMMIT: ${{ inputs.pr_destination_commit || env.PR_DESTINATION_COMMIT }} - run: /pipe.sh + run: | + [ -n "${{ inputs.cc_base_url }}" ] && export CC_BASE_URL="${{ inputs.cc_base_url }}" + [ -n "${{ inputs.anthropic_api_key }}" ] && export CC_API_KEY="${{ inputs.anthropic_api_key }}" + [ -n "${{ inputs.model }}" ] && export CC_MODEL="${{ inputs.model }}" + [ -n "${{ inputs.cc_bgmodel }}" ] && export CC_BGMODEL="${{ inputs.cc_bgmodel }}" + [ -n "${{ inputs.cc_metric_url }}" ] && export CC_METRIC_URL="${{ inputs.cc_metric_url }}" + [ -n "${{ inputs.gitea_token }}" ] && export VCS_ACCESS_TOKEN="${{ inputs.gitea_token }}" + [ -n "${{ inputs.server }}" ] && export SERVER="${{ inputs.server }}" + [ -n "${{ inputs.enable_reviewer_verification }}" ] && export ENABLE_REVIEWER_VERIFICATION="${{ inputs.enable_reviewer_verification }}" + [ -n "${{ inputs.log_level }}" ] && export LOG_LEVEL="${{ inputs.log_level }}" + [ -n "${{ inputs.options_type }}" ] && export OPTIONS_TYPE="${{ inputs.options_type }}" + [ -n "${{ inputs.cc_prompt }}" ] && export CC_PROMPT="${{ inputs.cc_prompt }}" + [ -n "${{ inputs.cc_allowed_tool }}" ] && export CC_ALLOWED_TOOL="${{ inputs.cc_allowed_tool }}" + [ -n "${{ inputs.cc_disallowed_tool }}" ] && export CC_DISALLOWED_TOOL="${{ inputs.cc_disallowed_tool }}" + [ -n "${{ inputs.repo_owner }}" ] && export REPO_OWNER="${{ inputs.repo_owner }}" + [ -n "${{ inputs.repo_slug }}" ] && export REPO_SLUG="${{ inputs.repo_slug }}" + [ -n "${{ inputs.source_branch }}" ] && export SOURCE_BRANCH="${{ inputs.source_branch }}" + [ -n "${{ inputs.source_commit }}" ] && export SOURCE_COMMIT="${{ inputs.source_commit }}" + [ -n "${{ inputs.pr_id }}" ] && export PR_ID="${{ inputs.pr_id }}" + [ -n "${{ inputs.pr_destination_branch }}" ] && export PR_DESTINATION_BRANCH="${{ inputs.pr_destination_branch }}" + [ -n "${{ inputs.pr_destination_commit }}" ] && export PR_DESTINATION_COMMIT="${{ inputs.pr_destination_commit }}" + + if [ -n "${{ inputs.team_name }}" ]; then + export TEAM_NAME="${{ inputs.team_name }}" + elif [ -z "$TEAM_NAME" ]; then + export TEAM_NAME="${{ github.repository_owner }}" + fi + + /pipe.sh branding: icon: 'message-circle'