ci: ejecutar standard-version automáticamente al mergear PR a init - #126
Merged
Conversation
…a init - Nuevo workflow .github/workflows/release.yml: se dispara con pull_request (types: closed) sobre la rama init, y solo corre el job si el PR fue efectivamente mergeado (github.event.pull_request.merged == true). - Ejecuta npm run release (standard-version): bump de versión, actualización de CHANGELOG.md, commit chore(release) y tag; luego hace push --follow-tags a init con el GITHUB_TOKEN por defecto. - Se añade standard-version a devDependencies (faltaba en package.json aunque ya se usaba en los scripts release/release:beta/pre:release) y se regenera package-lock.json en consecuencia.
There was a problem hiding this comment.
Pull request overview
Este PR agrega automatización de releases en CI para ejecutar standard-version cuando se mergea un Pull Request a la rama init, y asegura que la dependencia esté disponible durante npm ci.
Changes:
- Se agrega un workflow nuevo (
.github/workflows/release.yml) que intenta ejecutar un release al mergear PRs ainit(y permite ejecución manual). - Se agrega
standard-versionadevDependenciesy se actualizapackage-lock.jsonpara quenpm cilo instale en CI.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/release.yml |
Nuevo workflow para correr el proceso de release y pushear commit/tag a init. |
package.json |
Agrega standard-version a devDependencies para que el release pueda ejecutarse en CI. |
package-lock.json |
Refleja el agregado de standard-version y sus dependencias en el lockfile. |
Suppressed comments (1)
.github/workflows/release.yml:45
- El paso ejecuta
npm run release, pero enpackage.jsonno existe el scriptrelease, así que el job va a fallar. Comostandard-versionya está endevDependencies, podés ejecutarlo directamente connpx/npm exec, o bien agregar el script enpackage.json.
- name: Run release (standard-version)
run: npm run release
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…e.json Sin estos scripts, el workflow release.yml (PR #126) fallaría con 'Missing script: release' al ejecutar npm run release.
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.
Descripción
Agrega un GitHub Action que ejecuta
npm run release(standard-version) automáticamente cada vez que un Pull Request se mergea a la ramainit.Cambios
.github/workflows/release.yml(nuevo):pull_request(types: closed) sobreinit, y solo corre el job sigithub.event.pull_request.merged == true(ignora PRs cerrados sin mergear).workflow_dispatchpara poder ejecutarlo manualmente si hace falta.initconfetch-depth: 0(necesario para que standard-version calcule el changelog desde el último tag) →npm ci→ configurar identidad git del bot →npm run release→git push --follow-tags origin init.contents: writepara poder empujar el commitchore(release): vX.Y.Zy el tag generados por standard-version.package.json/package-lock.json: se detectó questandard-versionya se usaba en los scriptsrelease,release:betaypre:release, pero no estaba declarado endevDependencies(solo existía instalado localmente víayarn.lock, que no estaba versionado). Esto hubiera hecho fallarnpm cien el workflow. Se agregóstandard-version@^9.5.0adevDependenciesy se regenerópackage-lock.json.Notas
GITHUB_TOKENpor defecto, por lo que no dispara otros workflows en cadena (comportamiento estándar de GitHub Actions), evitando loops.standard-versionen sí ni las reglas de conventional commits del repo.Validación
npm ci && npm run build(con elpackage-lock.jsonregenerado) sin errores.Rama
ci/release-on-merge-to-init