chore: make workflow branch filters and guards branch-agnostic - #21
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preparación para renombrar la rama por defecto de
masteramain.Por qué
Sync standardslleva fallando todos los meses desde abril de 2026 (5 runs en rojo). La causa es que este repo pasatarget_branch: 'main'pero su rama por defecto se llamamaster: el reusable haceref: ${{ inputs.target_branch }}en el checkout y elgit 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.ymlasumenmain. Este repo es la excepción.Qué cambia
pushypull_requestaceptanmainymaster, para que no haya ninguna ventana sin CI durante el rename.github.ref == 'refs/heads/master'agithub.ref_name == github.event.repository.default_branch, que se resuelve en tiempo de ejecución y sobrevive a cualquier rename futuro.target_branchse 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
master→main.Sync standardsa mano para confirmar que vuelve a verde.branches: [ "main" ].🤖 Generated with Claude Code