Skip to content

Commit df417ef

Browse files
committed
perf: add branch deletion for parent img and app repos
1 parent 5add5c6 commit df417ef

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/workflows/pi_merge_parent_image.yml

+15
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,18 @@ jobs:
115115
build-args: |
116116
platform=linux/arm64
117117
label=dockerfile-path=https://github.com/refinery-${{ env.PARENT_IMAGE_TYPE }}-parent-image/blob/${{ github.sha }}/Dockerfile
118+
119+
gh-delete-branch:
120+
name: 'GitHub: Delete Branch'
121+
needs: [pi-build]
122+
if: !failure()
123+
runs-on: ubuntu-latest
124+
steps:
125+
- name: Checkout repository
126+
uses: actions/checkout@v4
127+
with:
128+
token: ${{ secrets.GH_TOKEN }}
129+
130+
- name: Delete Branch
131+
shell: bash
132+
run: git push origin --delete ${{ github.event.pull_request.head.ref }}

.github/workflows/pi_merge_submodule.yml

+39-1
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,42 @@ jobs:
181181
--body "${{ github.event.pull_request.body }}" \
182182
--base dev \
183183
--head ${{ needs.configure-branch-name.outputs.gh_head_ref }} \
184-
--repo ${{ github.repository_owner }}/${{ matrix.app }} || true
184+
--repo ${{ github.repository_owner }}/${{ matrix.app }} || true
185+
186+
gh-delete-submodule-branches:
187+
name: 'GitHub: Delete Branch'
188+
needs: [pi-matrix, pi-update-submodule, pi-update-app]
189+
if: !failure()
190+
runs-on: ubuntu-latest
191+
strategy:
192+
matrix:
193+
parent_image_type: ${{ fromJson(needs.pi-matrix.outputs.parent_image_type) }}
194+
steps:
195+
- name: Checkout repository
196+
uses: actions/checkout@v4
197+
with:
198+
token: ${{ secrets.GH_TOKEN }}
199+
repository: '${{ github.repository_owner }}/refinery-${{ matrix.parent_image_type }}-parent-image'
200+
201+
- name: Delete Branch
202+
shell: bash
203+
run: git push origin --delete ${{ github.event.pull_request.head.ref }}
204+
205+
gh-delete-app-branches:
206+
name: 'GitHub: Delete Branch'
207+
needs: [pi-matrix, pi-update-submodule, pi-update-app]
208+
if: !failure()
209+
runs-on: ubuntu-latest
210+
strategy:
211+
matrix:
212+
include: ${{ fromJson(needs.pi-matrix.outputs.include) }}
213+
steps:
214+
- name: Checkout repository
215+
uses: actions/checkout@v4
216+
with:
217+
token: ${{ secrets.GH_TOKEN }}
218+
repository: '${{ github.repository_owner }}/${{ matrix.app }}'
219+
220+
- name: Delete Branch
221+
shell: bash
222+
run: git push origin --delete ${{ github.event.pull_request.head.ref }}

0 commit comments

Comments
 (0)