From 30958a0f57bb41d3d8db0a55d7e3d93a3f12d0c9 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 12 Jul 2026 13:28:32 +0000 Subject: [PATCH] fix(ci): corrigir bugs nos workflows --- .github/workflows/auto-pr-from-main.yml | 38 ++++++++++++++++++++++--- .github/workflows/ci-build-test.yml | 4 +-- .github/workflows/code-quality.yml | 2 +- .github/workflows/security-scan.yml | 2 +- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/.github/workflows/auto-pr-from-main.yml b/.github/workflows/auto-pr-from-main.yml index b05b9d1..6f3411f 100644 --- a/.github/workflows/auto-pr-from-main.yml +++ b/.github/workflows/auto-pr-from-main.yml @@ -45,12 +45,42 @@ jobs: git checkout -b "$BRANCH_NAME" # List outdated packages - dotnet list QRCoder.Core.sln package --outdated + dotnet list QRCoder.Core.sln package --outdated --format json > outdated-packages.json - # Update packages (this is a simplified approach) + # Update packages using the latest available versions echo "📦 Updating NuGet packages..." - dotnet add src/Metar.Decoder package --version latest || echo "No updates needed for Metar.Decoder" - dotnet add src/Taf.Decoder package --version latest || echo "No updates needed for Taf.Decoder" + python3 - <<'PY' + import json + import pathlib + import subprocess + + data = json.loads(pathlib.Path("outdated-packages.json").read_text()) + updates = {} + + for project in data.get("projects", []): + project_path = pathlib.Path(project["path"]).resolve() + for framework in project.get("frameworks", []): + for package in framework.get("topLevelPackages", []): + latest = package.get("latestVersion") + requested = package.get("requestedVersion") + if latest and latest != requested: + updates.setdefault(project_path, {})[package["id"]] = latest + + for project_path, packages in updates.items(): + for package_name, latest_version in sorted(packages.items()): + subprocess.run( + [ + "dotnet", + "add", + str(project_path), + "package", + package_name, + "--version", + latest_version, + ], + check=True, + ) + PY # Check if there are any changes if git diff --quiet; then diff --git a/.github/workflows/ci-build-test.yml b/.github/workflows/ci-build-test.yml index 839ace4..944a670 100644 --- a/.github/workflows/ci-build-test.yml +++ b/.github/workflows/ci-build-test.yml @@ -312,8 +312,8 @@ jobs: - ✅ Performance Tests --- - *Este PR foi criado automaticamente pelo pipeline CI/CD* - branch: main + *Este PR foi criado automaticamente pelo pipeline CI/CD* + branch: auto-pr/${{ github.ref_name }} delete-branch: true draft: false labels: | diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 9785b43..1aa1a63 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -100,7 +100,7 @@ jobs: echo "✅ SONNAR_TOKEN is configured" dotnet sonarscanner begin \ /o:"afonsoft" \ - /k:"afonsoft_metar-decoder" \ + /k:"afonsoft_QRCoder.Core" \ /d:sonar.host.url="https://sonarcloud.io" \ /d:sonar.login="$SONAR_TOKEN" \ /d:sonar.scm.provider=git \ diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml index 021f938..6107f2c 100644 --- a/.github/workflows/security-scan.yml +++ b/.github/workflows/security-scan.yml @@ -125,7 +125,7 @@ jobs: echo "✅ SONNAR_TOKEN is configured" dotnet sonarscanner begin \ /o:"afonsoft" \ - /k:"afonsoft_metar-decoder" \ + /k:"afonsoft_QRCoder.Core" \ /d:sonar.host.url="https://sonarcloud.io" \ /d:sonar.login="${{ secrets.SONNAR_TOKEN }}" \ /d:sonar.scm.provider=git \