diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 8d61f71c25..2563874ff4 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -304,7 +304,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Node.js - - uses: actions/setup-node@v4 + uses: actions/setup-node@v4 with: node-version: '22.x' @@ -365,7 +365,7 @@ jobs: # Wait for TALAWA API to be healthy timeout=60 - until docker-compose -f docker-compose.dev.yaml exec -T talawa-api-dev curl -sf "http://talawa-api-dev:4000/health" 2>&1 || [ $timeout -eq 0 ]; do + until docker-compose -f docker-compose.dev.yaml exec -T talawa-api-dev curl -sf "http://localhost:4000/health" 2>&1 || [ $timeout -eq 0 ]; do echo "Waiting for API to start... ($timeout seconds remaining)" sleep 1 ((timeout--)) @@ -382,11 +382,12 @@ jobs: # Ensure cleanup runs even if the script fails cleanup() { + local exit_code=$? echo "Cleaning up containers..." if ! docker-compose -f docker-compose.dev.yaml down -v; then echo "Warning: Failed to cleanup containers" fi - } + exit $exit_code } trap cleanup EXIT env: