diff --git a/.github/actions/set-delete-branch/action.yml b/.github/actions/set-delete-branch/action.yml new file mode 100644 index 0000000..80f1440 --- /dev/null +++ b/.github/actions/set-delete-branch/action.yml @@ -0,0 +1,20 @@ +name: "Delete Branch" +description: "Permite borrar una rama especifica del repositorio" +inputs: + branchToDelete: + description: "Rama que sera eliminada" + required: true + baseBranch: + description: "Rama base del repositorio" + required: true +runs: + using: "composite" + steps: + - name: Borrando rama + shell: bash + run: | + git checkout ${{ inputs.baseBranch }} + git fetch; git pull + echo "Pasando a la rama base: ${{ inputs.baseBranch }}" + echo "Borrando rama: ${{ inputs.branchToDelete }}" + git push origin --delete ${{ inputs.branchToDelete }} diff --git a/.github/workflows/auto-release-beta.yml b/.github/workflows/auto-release-beta.yml index 49a8df9..cb98e85 100644 --- a/.github/workflows/auto-release-beta.yml +++ b/.github/workflows/auto-release-beta.yml @@ -19,8 +19,8 @@ jobs: - name: ✏️ CONFIGURACIONES PARA FIRMAR COMMITS uses: ./.github/actions/git-config with: - username: "Jmendez-Bot" - email: "jorge.mendez.ortega@gmail.com" + username: ${{ secrets.USER }} + email: ${{ secrets.EMAIL }} - name: 📝 CREANDO RELEASE uses: ./.github/actions/set-release diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 774d7e5..75118ca 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -19,8 +19,8 @@ jobs: - name: ✏️ CONFIGURACIONES PARA FIRMAR COMMITS uses: ./.github/actions/git-config with: - username: "Jmendez-Bot" - email: "jorge.mendez.ortega@gmail.com" + username: ${{ secrets.USER }} + email: ${{ secrets.EMAIL }} - name: 📝 CREANDO RELEASE uses: ./.github/actions/set-release diff --git a/.github/workflows/cleanup-merged-branch.yml b/.github/workflows/cleanup-merged-branch.yml new file mode 100644 index 0000000..fcd29f6 --- /dev/null +++ b/.github/workflows/cleanup-merged-branch.yml @@ -0,0 +1,27 @@ +name: cleanup-merged-branch +description: "Elimina ramas que han sido mergeadas a develop" +on: + pull_request: + branches: + - develop + types: + - closed +jobs: + delete-merged-branch: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + - name: ✏️ CONFIGURACIONES PARA FIRMAR COMMITS + uses: ./.github/actions/git-config + with: + username: ${{ secrets.USER }} + email: ${{ secrets.EMAIL }} + - name: 🗑 BORRANDO RAMA DEL ULTIMO MERGE + uses: ./.github/actions/set-delete-branch + with: + branchToDelete: ${{ github.event.pull_request.head.ref }} + baseBranch: develop diff --git a/.github/workflows/create-label.yml b/.github/workflows/create-label.yml index b87bff0..e4e0440 100644 --- a/.github/workflows/create-label.yml +++ b/.github/workflows/create-label.yml @@ -20,8 +20,8 @@ jobs: - name: ✏️ CONFIGURACIONES PARA FIRMAR COMMITS uses: ./.github/actions/git-config with: - username: "Jmendez-Bot" - email: "jorge.mendez.ortega@gmail.com" + username: ${{ secrets.USER }} + email: ${{ secrets.EMAIL }} - name: 🔖 CREANDO ETIQUETAS uses: ./.github/actions/set-labels @@ -50,3 +50,9 @@ jobs: defaultBranch: develop token: ${{ secrets.MY_TOKEN }} repo: ${{ github.repository }} + + - name: 🗑 BORRANDO RAMA INICIAL + uses: ./.github/actions/set-delete-branch + with: + branchToDelete: init + baseBranch: develop