Skip to content

Conversation

@konami12
Copy link
Owner

@konami12 konami12 commented Jun 2, 2025

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.

@konami12 konami12 requested a review from Copilot June 2, 2025 21:36
@konami12 konami12 self-assigned this Jun 2, 2025
@konami12 konami12 added the enhancement New feature or request label Jun 2, 2025
@konami12 konami12 merged commit 53a0fde into init Jun 2, 2025
1 check passed
@konami12 konami12 deleted the tmp-2-init branch June 2, 2025 21:37
Copy link

Copilot AI left a 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.yml and creates a new cleanup-merged-branch.yml workflow
  • Defines a composite action set-delete-branch to 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 name differs 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-run flag 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"
Copy link

Copilot AI Jun 2, 2025

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.

Suggested change
description: "Elimina ramas que han sido mergeadas a develop"
description: "Elimina ramas que han sido mergeadas a develop"
permissions:
contents: write

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,20 @@
name: "Delete Branch"
description: "Permite borrar una rama especifica del repositorio"
inputs:
Copy link

Copilot AI Jun 2, 2025

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.

Copilot uses AI. Check for mistakes.
steps:
- name: Borrando rama
shell: bash
run: |
Copy link

Copilot AI Jun 2, 2025

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🏗️ [template] Borrado de ramas al terminar un PR y al Realizar la primera configuracion

2 participants