Skip to content

Commit

Permalink
Tweak backport branch delete workflow to delete other merged branches (
Browse files Browse the repository at this point in the history
…#6809)

* Tweak backport branch delete workflow to delete other merged branches

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Add prevent condition due to SvanBoxel/delete-merged-branch#204 issues

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

---------

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon committed Mar 29, 2024
1 parent acdcc05 commit b694c5a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/delete_backport_branch.yml

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/delete_merged_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Delete merged branch of the PRs
on:
pull_request:
types:
- closed

jobs:
delete-branch:
runs-on: ubuntu-latest
if: |
startsWith(github.event.pull_request.head.repo.full_name, 'opensearch-project/documentation-website') &&
startsWith(! github.event.pull_request.head.ref, 'main') &&
startsWith(! github.event.pull_request.head.ref, '1.') &&
startsWith(! github.event.pull_request.head.ref, '2.') &&
startsWith(! github.event.pull_request.head.ref, 'version/')
steps:
- name: Echo remove branch
run: echo Removing ${{github.event.pull_request.head.ref}}
- name: Delete merged branch
uses: SvanBoxel/delete-merged-branch@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit b694c5a

Please sign in to comment.