From 0180ce77b1172b56a4c873adc9560a8cf1bfa96a Mon Sep 17 00:00:00 2001 From: Rohit Malhotra Date: Thu, 20 Feb 2025 11:40:23 -0500 Subject: [PATCH] [Bug]: Fix workflow definition for installation phase of resolver (#6861) --- .github/workflows/openhands-resolver.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/openhands-resolver.yml b/.github/workflows/openhands-resolver.yml index a69c320e5c..9820458ec3 100644 --- a/.github/workflows/openhands-resolver.yml +++ b/.github/workflows/openhands-resolver.yml @@ -88,12 +88,10 @@ jobs: run: | python -m pip index versions openhands-ai > openhands_versions.txt OPENHANDS_VERSION=$(head -n 1 openhands_versions.txt | awk '{print $2}' | tr -d '()') - # Ensure requirements.txt ends with newline before appending - if [ -f requirements.txt ] && [ -s requirements.txt ]; then - sed -i -e '$a\' requirements.txt - fi - echo "openhands-ai==${OPENHANDS_VERSION}" >> requirements.txt - cat requirements.txt + + # Create a new requirements.txt locally within the workflow, ensuring no reference to the repo's file + echo "openhands-ai==${OPENHANDS_VERSION}" > /tmp/requirements.txt + cat /tmp/requirements.txt - name: Cache pip dependencies if: | @@ -111,9 +109,9 @@ jobs: uses: actions/cache@v4 with: path: ${{ env.pythonLocation }}/lib/python3.12/site-packages/* - key: ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('requirements.txt') }} + key: ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('/tmp/requirements.txt') }} restore-keys: | - ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('requirements.txt') }} + ${{ runner.os }}-pip-openhands-resolver-${{ hashFiles('/tmp/requirements.txt') }} - name: Check required environment variables env: @@ -225,7 +223,7 @@ jobs: } else { console.log("Installing from requirements.txt..."); await exec.exec("python -m pip install --upgrade pip"); - await exec.exec("pip install -r requirements.txt"); + await exec.exec("pip install -r /tmp/requirements.txt"); } - name: Attempt to resolve issue