diff --git a/.github/workflows/quality-gate.yml b/.github/workflows/quality-gate.yml index 997202a..4cb59fc 100644 --- a/.github/workflows/quality-gate.yml +++ b/.github/workflows/quality-gate.yml @@ -101,16 +101,20 @@ jobs: per_page: 1 }); - let lastReleaseVersion = '0.0.0'; + let lastReleaseVersion = null; + let newVersion = null; + if (releases.length > 0) { lastReleaseVersion = releases[0].tag_name.replace(/^v/, ''); console.log(`Latest release version: ${lastReleaseVersion}`); + // Calcular a nova versão baseada na última release + newVersion = calculateVersion(lastReleaseVersion, branchName); } else { - console.log('No releases found, using 0.0.0 as baseline'); + console.log('No releases found, starting from 0.0.0'); + lastReleaseVersion = 'N/A'; + // Primeira release: começar com 0.0.0 independente do tipo de branch + newVersion = '0.0.0'; } - - // Calcular a nova versão baseada no branch - const newVersion = calculateVersion(lastReleaseVersion, branchName); console.log(`Calculated version: ${newVersion}`); // Exportar a versão como output @@ -176,6 +180,18 @@ jobs: run: | git config --global url."https://oauth2:${GH_APP_TOKEN}@github.com/".insteadOf "https://github.com/" + - name: 🧹 Free Disk Space + run: | + echo "Disk space before cleanup:" + df -h + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/local/lib/android + sudo rm -rf /opt/ghc + sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo docker image prune --all --force + echo "Disk space after cleanup:" + df -h + - name: 🔧 Setup Python uses: actions/setup-python@v4 with: @@ -192,8 +208,8 @@ jobs: - name: 📦 Install Dependencies run: | python -m pip install --upgrade pip - pip install -r ${{ steps.prepare-requirements.outputs.PROCESSED_REQUIREMENTS_FILE }} - pip install -r requirements-dev.txt + pip install --no-cache-dir -r ${{ steps.prepare-requirements.outputs.PROCESSED_REQUIREMENTS_FILE }} + pip install --no-cache-dir -r requirements-dev.txt - name: 📝 Code Formatting Check (Ruff) run: |