feat(actions): configuraciones para borrar ramas despues de un PR#4
feat(actions): configuraciones para borrar ramas despues de un PR#4
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces automated branch cleanup after pull requests are merged and centralizes Git author configuration via secrets.
- Replaces hard-coded Git user/email with
${{ secrets.USER }}and${{ secrets.EMAIL }}across workflows - Adds initial-branch deletion in
create-label.ymland creates a newcleanup-merged-branch.ymlworkflow - Defines a composite action
set-delete-branchto handle branch deletion
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/create-label.yml | Switched Git config to secrets and added initial branch cleanup |
| .github/workflows/cleanup-merged-branch.yml | New workflow to delete any branch after it's merged into develop |
| .github/workflows/auto-release.yml | Switched Git config to secrets |
| .github/workflows/auto-release-beta.yml | Switched Git config to secrets |
| .github/actions/set-delete-branch/action.yml | Composite action that checks out the base branch and deletes the specified branch |
Comments suppressed due to low confidence (2)
.github/actions/set-delete-branch/action.yml:1
- [nitpick] The action
namediffers from the folder and usage (set-delete-branch). Consider renaming for consistency (e.g.,Set Delete Branch).
name: "Delete Branch"
.github/actions/set-delete-branch/action.yml:20
- There are no tests or dry-run steps covering this action. Consider adding a simple test or a
--dry-runflag to validate deletion logic in CI before mutating real branches.
git push origin --delete ${{ inputs.branchToDelete }}
| @@ -0,0 +1,27 @@ | |||
| name: cleanup-merged-branch | |||
| description: "Elimina ramas que han sido mergeadas a develop" | |||
There was a problem hiding this comment.
Explicitly declare permissions: at the top (e.g., contents: write) so the workflow has rights to delete branches with GITHUB_TOKEN.
| description: "Elimina ramas que han sido mergeadas a develop" | |
| description: "Elimina ramas que han sido mergeadas a develop" | |
| permissions: | |
| contents: write |
| @@ -0,0 +1,20 @@ | |||
| name: "Delete Branch" | |||
| description: "Permite borrar una rama especifica del repositorio" | |||
| inputs: | |||
There was a problem hiding this comment.
Consider adding a token input so callers can supply a custom PAT or the default GITHUB_TOKEN, improving flexibility and security.
| steps: | ||
| - name: Borrando rama | ||
| shell: bash | ||
| run: | |
There was a problem hiding this comment.
Add a check for branch existence before attempting deletion (e.g., git show-ref --verify --quiet refs/heads/${{ inputs.branchToDelete }}) to avoid errors when the branch is already gone.
close #2
📝 Descripción
Actions para eliminar ramas despues de hacer el merge a develop, tambien se borra la rama de init cuando el template es utilizado para otro repo.
📎 Issue Relacionado
Resuelve: #2
📝 Notas adicionales
Todo se manejo con los actions que tenemos por defecto y se agregaron los nuevos campos para el proceso de configuracion.