feat(release-please): add TARGET_BRANCH input for maintenance branches - #70
Open
rodrigo2604 wants to merge 1 commit into
Open
feat(release-please): add TARGET_BRANCH input for maintenance branches#70rodrigo2604 wants to merge 1 commit into
rodrigo2604 wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fernan-Ramos
approved these changes
Aug 11, 2026
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.
[MAC-2491]
What changes does this PR introduce
Añade un input opcional
TARGET_BRANCHarelease-please-app.ymly lo propaga comotarget-branchdel action, para poder correr release-please contra una rama de mantenimiento en lugar del default branch del repo.Any background context you want to provide
El problema
taxdown/buildtienemasteren4.xy una línea de mantenimiento2.xviva enrelease/v2(hoy2.3.1), con consumers clavados en^2.3.0. Para que un backport mergeado enrelease/v2genere release y publique en npm, release-please tiene que correr contra esa rama.Añadir
release/v2alon.pushdel repo consumidor no basta: este reusable invoca el action sintarget-branch, y con ese input vacío release-please cae al default branch del repo. Confirmado ensrc/index.ts— el input se propaga comodefaultBranchdel clienteGitHub, y de ahí aManifest.fromManifest(github, github.repository.defaultBranch, ...); si vieneundefined, se resuelve por API.Resultado sin este PR: un push a
release/v2lanzaría el workflow, pero release-please leería el manifest demaster(4.2.0) y gromearía el release PR contramaster. Cero efecto sobre la línea 2.x.Por qué es retrocompatible
~30 repos consumen este reusable con
@main, así que el riesgo de regresión es lo relevante aquí. No lo hay:TARGET_BRANCHdefault'', y el action normaliza el string vacío aundefined:Pasar
target-branch: ''es por tanto indistinguible de no pasarlo. Todos los consumidores actuales mantienen exactamente el comportamiento de hoy; solo cambia el de quien opte explícitamente por el input.Limitación conocida (no la toca este PR)
El job
automergebusca el release PR con--head "release-please--branches--main"hardcodeado. release-please nombra esa ramarelease-please--branches--<target-branch>[--components--<component>], así que conTARGET_BRANCHpuesto elfind-prno encontrará nada y el auto-merge hará no-op silencioso.Vale la pena señalar que eso ya está roto hoy para cualquier repo cuyo default branch no sea
main: entaxdown/buildel head real esrelease-please--branches--master--components--build. ComoAUTO_MERGEes opt-in y por defectofalse, ningún consumidor actual lo sufre. Lo dejo fuera del scope a propósito; si queréis lo arreglo en un PR aparte derivando el head deTARGET_BRANCHy del default branch.Where should the reviewer start
.github/workflows/release-please-app.yml— 6 líneas, el input nuevo y su propagación al step.El primer consumidor será
taxdown/build#130, que pasaráTARGET_BRANCH: release/v2. Verificación end-to-end allí: que el release PR se abra contrarelease/v2y que el tag salgav2.3.x.