Skip to content

Commit 2e088bb

Browse files
committed
Fallback to main on destroy
1 parent 267f8dc commit 2e088bb

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/on-pr-close.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,17 @@ jobs:
2626
runs-on: [self-hosted, ci]
2727
needs: [parse-secrets]
2828
steps:
29-
- uses: actions/checkout@v4
29+
- name: Checkout Branch
30+
id: checkout-build-branch
31+
uses: actions/checkout@v4
32+
continue-on-error: true
3033
with:
31-
ref: ${{ env.BRANCH_NAME || 'main' }}
34+
ref: ${{ env.BRANCH_NAME }}
35+
- name: Fallback to main
36+
if: steps.checkout-build-branch.outcome == 'failure'
37+
uses: actions/checkout@v4
38+
with:
39+
ref: main
3240
- uses: ./.github/actions/make/
3341
with:
3442
command: build
@@ -39,9 +47,17 @@ jobs:
3947
runs-on: [self-hosted, ci]
4048
needs: [parse-secrets, build-base]
4149
steps:
42-
- uses: actions/checkout@v4
50+
- name: Checkout Branch for destroy
51+
id: checkout-destroy-branch
52+
uses: actions/checkout@v4
53+
continue-on-error: true
54+
with:
55+
ref: ${{ env.BRANCH_NAME }}
56+
- name: Fallback to main for destroy
57+
if: steps.checkout-destroy-branch.outcome == 'failure'
58+
uses: actions/checkout@v4
4359
with:
44-
ref: ${{ env.BRANCH_NAME || 'main' }}
60+
ref: main
4561
fetch-depth: 0
4662
- name: Remove PR workspaces
4763
uses: ./.github/actions/make/

0 commit comments

Comments
 (0)