diff --git a/actions/detailed-review/action.yml b/actions/detailed-review/action.yml index 407c8e701..bf26ca06d 100644 --- a/actions/detailed-review/action.yml +++ b/actions/detailed-review/action.yml @@ -219,7 +219,7 @@ runs: # Test Continue CLI availability if [ "$SKIP_CLI" != "true" ]; then echo "Testing Continue CLI..." - if ! cn --version; then + if ! timeout 10 cn --version; then echo "Warning: Continue CLI not found or not working" cat > inline_review.json << 'EOF' { @@ -234,7 +234,8 @@ runs: # Run the CLI and capture JSON output with error handling if [ "$SKIP_CLI" != "true" ]; then echo "Executing Continue CLI with org: ${{ inputs.continue-org }}, config: ${{ inputs.continue-config }}" - if ! cn --readonly --format json --org "${{ inputs.continue-org }}" --config "${{ inputs.continue-config }}" -p "$(cat inline_review_prompt.txt)" > inline_review_raw.json 2>cli_error.log; then + # Use timeout to prevent hanging (120 seconds max) + if ! timeout 120 cn --readonly --format json --org "${{ inputs.continue-org }}" --config "${{ inputs.continue-config }}" -p "$(cat inline_review_prompt.txt)" > inline_review_raw.json 2>cli_error.log; then echo "Warning: Continue CLI command failed" echo "CLI error log:" cat cli_error.log diff --git a/actions/general-review/action.yml b/actions/general-review/action.yml index f90bd398c..51c2812d3 100644 --- a/actions/general-review/action.yml +++ b/actions/general-review/action.yml @@ -189,7 +189,7 @@ EOF # Test Continue CLI availability if [ "$SKIP_CLI" != "true" ]; then echo "Testing Continue CLI..." - if ! cn --version; then + if ! timeout 10 cn --version; then echo "Warning: Continue CLI not found or not working" cat > code_review.md << 'EOF' ## Code Review Summary @@ -207,7 +207,8 @@ EOF # Run the CLI with validated config and error handling if [ "$SKIP_CLI" != "true" ]; then echo "Executing Continue CLI with org: $CONTINUE_ORG, config: $CONTINUE_CONFIG" - if ! cn --readonly --org "$CONTINUE_ORG" --config "$CONTINUE_CONFIG" -p "$(cat review_prompt.txt)" > code_review.md 2>cli_error.log; then + # Use timeout to prevent hanging (120 seconds max) + if ! timeout 120 cn --readonly --org "$CONTINUE_ORG" --config "$CONTINUE_CONFIG" -p "$(cat review_prompt.txt)" > code_review.md 2>cli_error.log; then echo "Error: Continue CLI command failed" echo "CLI error log:" cat cli_error.log