diff --git a/.github/workflows/delete_backport_branch.yml b/.github/workflows/delete_backport_branch.yml index ad1560c3bf..a97d2674e4 100644 --- a/.github/workflows/delete_backport_branch.yml +++ b/.github/workflows/delete_backport_branch.yml @@ -1,13 +1,18 @@ -name: Delete merged branch of the backport PRs -on: +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, 'peterzhuamazon/documentation-website') + 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}}