From 489b86f8218ff8cd3d5ef857ffd4673a5ed8c733 Mon Sep 17 00:00:00 2001 From: dmolinari Date: Mon, 16 Mar 2026 10:48:42 -0300 Subject: [PATCH] feat: forzar indexacion de commits de gitea --- .gitea/workflows/release-please.yaml | 31 ++++++++++++++++------------ 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/release-please.yaml b/.gitea/workflows/release-please.yaml index c068f40..25dbd79 100644 --- a/.gitea/workflows/release-please.yaml +++ b/.gitea/workflows/release-please.yaml @@ -15,19 +15,31 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 # Descarga todo el historial para evitar errores de Gitea - # 1. Ejecutar Release Please (Con inyección de entorno) - name: Release Please id: release uses: https://repo.eldiaservicios.com/dmolinari/gitea-release-please-action@main - # Le pasamos el token por entorno para evitar el 401 de Octokit env: GITHUB_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }} with: token: ${{ secrets.RELEASE_PLEASE_TOKEN }} release-type: simple - # 2. Si Release Please falla al hacer el PR (Error 401), lo hacemos nosotros nativamente + # NUEVO PASO: Despierta a Gitea para que reconozca los cambios + - name: Forzar actualización de rama en Gitea + if: failure() + run: | + echo "Despertando a Gitea para que indexe los cambios..." + git config --global user.name "Gitea Actions" + git config --global user.email "actions@gitea.local" + git fetch origin release-please--branches--main + git checkout release-please--branches--main + git commit --allow-empty -m "chore: forzar indexacion visual en Gitea" + git remote set-url origin https://x-access-token:${{ secrets.RELEASE_PLEASE_TOKEN }}@repo.eldiaservicios.com/${{ github.repository }}.git + git push origin release-please--branches--main + - name: Rescate - Crear Pull Request Manualmente if: failure() env: @@ -37,15 +49,10 @@ jobs: node -e ' async function run() { const giteaUrl = "https://repo.eldiaservicios.com/api/v1"; - const repo = process.env.REPO; - const token = process.env.GITEA_TOKEN; - - console.log("Intentando rescatar el proceso y crear el PR nativamente..."); - - const prRes = await fetch(`${giteaUrl}/repos/${repo}/pulls`, { + const prRes = await fetch(`${giteaUrl}/repos/${process.env.REPO}/pulls`, { method: "POST", headers: { - "Authorization": `token ${token}`, + "Authorization": `token ${process.env.GITEA_TOKEN}`, "Content-Type": "application/json" }, body: JSON.stringify({ @@ -55,9 +62,8 @@ jobs: body: "🤖 Pull Request generado automáticamente por el sistema de CI/CD. (Rescatado por script)" }) }); - if (prRes.ok) { - console.log("✅ ¡Pull Request creado exitosamente por el script de rescate!"); + console.log("✅ ¡Pull Request creado exitosamente!"); } else { console.log("❌ Falló el rescate:", await prRes.text()); process.exit(1); @@ -66,7 +72,6 @@ jobs: run().catch(err => { console.error(err); process.exit(1); }); ' - # 3. Generar notas con IA Local - name: Generar notas con IA Local if: ${{ steps.release.outputs.release_created }} env: