Skip to content

Commit bf3a06d

Browse files
committed
Gate delete workflow on config readiness
1 parent fdda08d commit bf3a06d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/cpflow-delete-review-app.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
uses: actions/checkout@v4
5454

5555
- name: Validate required secrets and variables
56+
id: config
5657
uses: ./.github/actions/cpflow-validate-config
5758
env:
5859
CPLN_TOKEN_STAGING: ${{ secrets.CPLN_TOKEN_STAGING }}
@@ -66,6 +67,7 @@ jobs:
6667
pull_request_friendly: "true"
6768

6869
- name: Setup environment
70+
if: steps.config.outputs.ready == 'true'
6971
uses: ./.github/actions/cpflow-setup-environment
7072
with:
7173
token: ${{ secrets.CPLN_TOKEN_STAGING }}
@@ -74,6 +76,7 @@ jobs:
7476
cpflow_version: ${{ vars.CPFLOW_VERSION }}
7577

7678
- name: Set workflow links
79+
if: steps.config.outputs.ready == 'true'
7780
uses: actions/github-script@v7
7881
with:
7982
script: |
@@ -85,6 +88,7 @@ jobs:
8588
);
8689
8790
- name: Create initial PR comment
91+
if: steps.config.outputs.ready == 'true'
8892
id: create-comment
8993
uses: actions/github-script@v7
9094
with:
@@ -98,13 +102,15 @@ jobs:
98102
core.setOutput("comment-id", comment.data.id);
99103
100104
- name: Delete review app
105+
if: steps.config.outputs.ready == 'true'
101106
uses: ./.github/actions/cpflow-delete-control-plane-app
102107
with:
103108
app_name: ${{ env.APP_NAME }}
104109
cpln_org: ${{ vars.CPLN_ORG_STAGING }}
105110
review_app_prefix: ${{ vars.REVIEW_APP_PREFIX }}
106111

107112
- name: Mark GitHub deployment inactive
113+
if: steps.config.outputs.ready == 'true'
108114
uses: actions/github-script@v7
109115
with:
110116
script: |
@@ -132,7 +138,7 @@ jobs:
132138
}
133139
134140
- name: Finalize delete status
135-
if: always()
141+
if: always() && steps.config.outputs.ready == 'true'
136142
uses: actions/github-script@v7
137143
with:
138144
script: |

0 commit comments

Comments
 (0)