Skip to content

Commit e113f47

Browse files
committed
add debugging
1 parent 751eb87 commit e113f47

File tree

5 files changed

+51
-1
lines changed

5 files changed

+51
-1
lines changed

.github/actions/delete-control-plane-app/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ runs:
1414
steps:
1515
- name: Delete Application
1616
shell: bash
17-
run: ${{ github.action_path }}/../deploy-to-control-plane/scripts/delete-app.sh
17+
run: ${{ github.action_path }}/scripts/delete-app.sh
1818
env:
1919
APP_NAME: ${{ inputs.app_name }}
2020
CPLN_ORG: ${{ inputs.org }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
# Script to delete a Control Plane application
4+
# Required environment variables:
5+
# - APP_NAME: Name of the application to delete
6+
# - CPLN_ORG: Organization name
7+
8+
set -e
9+
10+
# Validate required environment variables
11+
: "${APP_NAME:?APP_NAME environment variable is required}"
12+
: "${CPLN_ORG:?CPLN_ORG environment variable is required}"
13+
14+
# Safety check: prevent deletion of production or staging apps
15+
if echo "$APP_NAME" | grep -iqE '(production|staging)'; then
16+
echo "❌ ERROR: Cannot delete apps containing 'production' or 'staging' in their name" >&2
17+
echo "🛑 This is a safety measure to prevent accidental deletion of production or staging environments" >&2
18+
echo " App name: $APP_NAME" >&2
19+
exit 1
20+
fi
21+
22+
# Check if app exists before attempting to delete
23+
echo "🔍 Checking if application exists: $APP_NAME"
24+
if ! cpflow exists -a "$APP_NAME"; then
25+
echo "⚠️ Application does not exist: $APP_NAME"
26+
exit 0
27+
fi
28+
29+
# Delete the application
30+
echo "🗑️ Deleting application: $APP_NAME"
31+
if ! cpflow delete -a "$APP_NAME" --force; then
32+
echo "❌ Failed to delete application: $APP_NAME" >&2
33+
exit 1
34+
fi
35+
36+
echo "✅ Successfully deleted application: $APP_NAME"

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

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ env:
1919
PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number }}
2020

2121
jobs:
22+
debug:
23+
uses: ./.github/workflows/debug-workflow.yml
24+
with:
25+
debug_enabled: false # Will still run if vars.DEBUG_WORKFLOW is true
2226
Process-Delete-Command:
2327
if: |
2428
(github.event_name == 'issue_comment' &&

.github/workflows/help-command.yml

+5
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ permissions:
1818
pull-requests: write
1919

2020
jobs:
21+
debug:
22+
uses: ./.github/workflows/debug-workflow.yml
23+
with:
24+
debug_enabled: false # Will still run if vars.DEBUG_WORKFLOW is true
25+
2126
show-help:
2227
if: |
2328
github.event_name == 'workflow_dispatch' ||

.github/workflows/review-app-help.yml

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ permissions:
99
pull-requests: write
1010

1111
jobs:
12+
debug:
13+
uses: ./.github/workflows/debug-workflow.yml
14+
with:
15+
debug_enabled: false # Will still run if vars.DEBUG_WORKFLOW is true
16+
1217
show-quick-help:
1318
if: github.event_name == 'pull_request'
1419
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)