-
Notifications
You must be signed in to change notification settings - Fork 0
feat(actions): configuraciones para borrar ramas despues de un PR #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" | |||
Copilot
AI
Jun 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: | |||
Copilot
AI
Jun 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: | |
Copilot
AI
Jun 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.