Skip to content

Commit 05072aa

Browse files
committed
Delete by default after merge
1 parent 0b162bc commit 05072aa

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

.github/actions/merge/action.yaml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ inputs:
2525
description: "GitHub token to use for pull/push"
2626
type: string
2727
required: true
28-
delete_branch:
29-
description: "Delete the source branch after merge"
30-
type: boolean
31-
default: false
3228

3329
runs:
3430
using: "composite"
@@ -64,18 +60,7 @@ runs:
6460
GH_TOKEN: ${{ inputs.token_pr }}
6561
- name: Merge the created PR
6662
if: ${{ inputs.merge == 'true' }}
67-
run: gh pr merge --merge --admin
63+
run: gh pr merge --merge --admin --delete-branch
6864
shell: bash
6965
env:
7066
GH_TOKEN: ${{ inputs.token_pr }}
71-
- name: Delete the source branch
72-
if: ${{ inputs.merge == 'true' && inputs.delete_branch == 'true' }}
73-
run: |
74-
if git show-ref --verify --quiet refs/heads/${{ steps.push.outputs.branch }}; then
75-
git push origin -d ${{ steps.push.outputs.branch }}
76-
else
77-
echo "Nothing to delete. Branch ${{ steps.push.outputs.branch }} does not exist."
78-
fi
79-
shell: bash
80-
env:
81-
GH_TOKEN: ${{ inputs.token_pr }}

.github/workflows/rel-dev-back-merge.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ jobs:
2121
target: "rel/dev"
2222
token_pr: ${{ secrets.TOKEN_GITHUB_YENKINS_ADMIN }}
2323
token_push: ${{ secrets.TOKEN_GITHUB_YENKINS_ADMIN }}
24-
delete_branch: true

0 commit comments

Comments
 (0)