ci: usar URL publica de Forgejo desde los jobs del runner
Validacion / gitflow (push) Failing after 5s Details
Validacion / ansible (push) Failing after 5s Details
Validacion / terraform (push) Successful in 26s Details
Validacion / secretos (push) Successful in 16s Details
Validacion / gitflow (pull_request) Failing after 6s Details
Validacion / ansible (pull_request) Failing after 5s Details
Validacion / terraform (pull_request) Successful in 25s Details
Validacion / secretos (pull_request) Successful in 4s Details

This commit is contained in:
bryancito1090 2026-11-05 11:14:08 -05:00
parent 2c11b90238
commit b6d9f6bceb
2 changed files with 16 additions and 4 deletions

View File

@ -17,12 +17,14 @@ jobs:
fetch-depth: 0 fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false persist-credentials: false
github-server-url: https://git.bryan-bano.com
- uses: https://github.com/actions/setup-python@v5 - uses: https://github.com/actions/setup-python@v5
with: with:
python-version: '3.12' python-version: '3.12'
- name: Validar rama, issue, milestone, etiquetas y commits - name: Validar rama, issue, milestone, etiquetas y commits
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_SERVER_URL: https://git.bryan-bano.com
run: python scripts/check_gitflow.py run: python scripts/check_gitflow.py
ansible: ansible:
@ -33,6 +35,7 @@ jobs:
with: with:
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false persist-credentials: false
github-server-url: https://git.bryan-bano.com
- uses: https://github.com/actions/setup-python@v5 - uses: https://github.com/actions/setup-python@v5
with: with:
python-version: '3.12' python-version: '3.12'
@ -56,6 +59,7 @@ jobs:
with: with:
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false persist-credentials: false
github-server-url: https://git.bryan-bano.com
- uses: https://github.com/hashicorp/setup-terraform@v3 - uses: https://github.com/hashicorp/setup-terraform@v3
with: with:
terraform_version: '1.15.9' terraform_version: '1.15.9'
@ -76,16 +80,22 @@ jobs:
fetch-depth: 0 fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.sha }} ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false persist-credentials: false
github-server-url: https://git.bryan-bano.com
- name: Descargar Gitleaks y verificar checksum - name: Descargar Gitleaks y verificar checksum
run: | run: |
set -eu set -eu
mkdir -p /tmp/tesis-gitleaks mkdir -p /tmp/tesis-gitleaks
cd /tmp/tesis-gitleaks cd /tmp/tesis-gitleaks
base=https://github.com/gitleaks/gitleaks/releases/download/v8.24.3 base=https://github.com/gitleaks/gitleaks/releases/download/v8.24.3
curl -fsSLO "$base/gitleaks_8.24.3_linux_x64.tar.gz" case "$(uname -m)" in
x86_64) archive=gitleaks_8.24.3_linux_x64.tar.gz ;;
aarch64|arm64) archive=gitleaks_8.24.3_linux_arm64.tar.gz ;;
*) echo "Arquitectura no soportada" >&2; exit 1 ;;
esac
curl -fsSLO "$base/$archive"
curl -fsSLO "$base/gitleaks_8.24.3_checksums.txt" curl -fsSLO "$base/gitleaks_8.24.3_checksums.txt"
sha256sum --check --ignore-missing gitleaks_8.24.3_checksums.txt sha256sum --check --ignore-missing gitleaks_8.24.3_checksums.txt
tar -xzf gitleaks_8.24.3_linux_x64.tar.gz gitleaks tar -xzf "$archive" gitleaks
- name: Buscar secretos en los commits del cambio - name: Buscar secretos en los commits del cambio
env: env:
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }} BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}

View File

@ -2,7 +2,7 @@
Ansible se entrega desde `feature/1-ansible-portal-cloudwatch`, asociada al Issue #1 en Forgejo, hacia `develop`. No se hace push directo a `develop` o `main`. Ansible se entrega desde `feature/1-ansible-portal-cloudwatch`, asociada al Issue #1 en Forgejo, hacia `develop`. No se hace push directo a `develop` o `main`.
El workflow [security.yml](../.forgejo/workflows/security.yml) usa un runner `ubuntu-latest`, Linux x86_64 con Node compatible con Actions y acceso HTTPS a GitHub, PyPI, Galaxy y los registros Terraform: El workflow [security.yml](../.forgejo/workflows/security.yml) usa un runner `ubuntu-latest`, Linux x86_64 o ARM64 con Node compatible con Actions y acceso HTTPS a GitHub, PyPI, Galaxy y los registros Terraform:
| Job | Comprobacion | | Job | Comprobacion |
|---|---| |---|---|
@ -24,7 +24,7 @@ En **Settings → Branches**, protege `develop`:
- Bloquear merge con rama desactualizada o revisiones que soliciten cambios. - Bloquear merge con rama desactualizada o revisiones que soliciten cambios.
- Descartar aprobaciones obsoletas. - Descartar aprobaciones obsoletas.
Usa los nombres exactos de los estados del primer PR, no solo los del evento `push`. La proteccion se configura en Forgejo: el YAML por si solo no bloquea merges. Los administradores conservan las facultades del servidor; el flujo ordinario debe respetar checks y PR. Protege tambien `main` contra push directo; los cortes de version siguen el flujo de release documentado. Los contextos obligatorios configurados son `Validacion / gitflow (pull_request)`, `Validacion / ansible (pull_request)`, `Validacion / terraform (pull_request)` y `Validacion / secretos (pull_request)`. La proteccion se configura en Forgejo: el YAML por si solo no bloquea merges. Los administradores conservan las facultades del servidor; el flujo ordinario debe respetar checks y PR. Protege tambien `main` contra push directo; los cortes de version siguen el flujo de release documentado.
## Uso diario ## Uso diario
@ -36,3 +36,5 @@ Usa los nombres exactos de los estados del primer PR, no solo los del evento `pu
6. Esperar los cuatro checks del ultimo commit y revisar el diff antes de integrar. 6. Esperar los cuatro checks del ultimo commit y revisar el diff antes de integrar.
En Forgejo 1.21, editar etiquetas o milestone puede no iniciar otra ejecucion. Completa los metadatos al crear el PR o relanza el workflow tras editarlos. No se publican comentarios automaticos ni se almacenan tokens personales o credenciales AWS en el YAML; el token efimero solo lee metadatos. En Forgejo 1.21, editar etiquetas o milestone puede no iniciar otra ejecucion. Completa los metadatos al crear el PR o relanza el workflow tras editarlos. No se publican comentarios automaticos ni se almacenan tokens personales o credenciales AWS en el YAML; el token efimero solo lee metadatos.
El runner anuncia internamente `http://forgejo:3000`, que no resuelve desde los contenedores de jobs. El checkout y las consultas de metadatos usan explicitamente `https://git.bryan-bano.com`; el runner debe poder alcanzar esa URL. No se desactiva la verificacion TLS.