fix: Add timeout to CLI commands to prevent workflow hanging
- Add 10 second timeout for CLI version check - Add 120 second timeout for main CLI execution - Prevents workflows from timing out (10 minute GitHub Actions limit) - Ensures graceful failure with fallback messages if CLI hangs
This commit is contained in:
parent
a5de88907c
commit
6c8c6ca9d9
2 changed files with 6 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue