Skip to content

chore: make workflow branch filters and guards branch-agnostic - #21

Merged
jcant0n merged 2 commits into
masterfrom
chore/branch-agnostic-workflows
Aug 1, 2026
Merged

chore: make workflow branch filters and guards branch-agnostic#21
jcant0n merged 2 commits into
masterfrom
chore/branch-agnostic-workflows

Conversation

@jcant0n

@jcant0n jcant0n commented Aug 1, 2026

Copy link
Copy Markdown
Member

Preparación para renombrar la rama por defecto de master a main.

Por qué

Sync standards lleva fallando todos los meses desde abril de 2026 (5 runs en rojo). La causa es que este repo pasa target_branch: 'main' pero su rama por defecto se llama master: el reusable hace ref: ${{ inputs.target_branch }} en el checkout y el git fetch origin +refs/heads/main* nunca resuelve.

De los 15 repos de la flota de bindings, 11 ya usan main, y tanto las plantillas oficiales (evergine-standards-template-*) como el default de _sync-standards-reusable.yml asumen main. Este repo es la excepción.

Qué cambia

  • CI: los filtros de push y pull_request aceptan main y master, para que no haya ninguna ventana sin CI durante el rename.
  • CD y Sync standards: el guard pasa de github.ref == 'refs/heads/master' a github.ref_name == github.event.repository.default_branch, que se resuelve en tiempo de ejecución y sobrevive a cualquier rename futuro.
  • Sync standards: target_branch se deriva de la rama por defecto del repo en vez del literal 'main'.

Por qué el guard importa

Si se renombrara la rama sin tocar este if:, el cron mensual se saltaría el job y el run aparecería en verde: ni publica ni sincroniza, y el badge sigue OK. Es el modo de fallo que hay que eliminar, no solo el rojo actual.

Después de mergear

  1. Renombrar mastermain.
  2. Lanzar Sync standards a mano para confirmar que vuelve a verde.
  3. PR de limpieza dejando branches: [ "main" ].

🤖 Generated with Claude Code

jcant0n and others added 2 commits August 1, 2026 13:59
Prepares the repository for renaming the default branch from master to
main without losing CI coverage or silently skipping scheduled jobs.

- CI: accept both main and master in push/pull_request filters so there
  is no window without CI during the rename.
- CD and Sync standards: replace the hardcoded
  `github.ref == 'refs/heads/master'` guard with
  `github.ref_name == github.event.repository.default_branch`, which
  resolves at runtime and survives any future rename. With the old
  guard, a rename would make the scheduled job skip while the run still
  reported success.
- Sync standards: derive target_branch from the repository default
  branch instead of the 'main' literal. That literal is why this
  workflow has been failing every month since April 2026: the reusable
  workflow checks out `ref: target_branch` and this repository's default
  branch is master, so the checkout could never resolve.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Empty default so a manual run with the field left blank resolves to the
repository default branch instead of a hardcoded name.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jcant0n
jcant0n merged commit 5bb3ab6 into master Aug 1, 2026
1 check passed
@jcant0n
jcant0n deleted the chore/branch-agnostic-workflows branch August 1, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant