Skip to content

Commit ab2c72b

Browse files
committed
don't deploy on pull request trigger
1 parent f1af979 commit ab2c72b

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

.github/workflows/deploy-to-control-plane-review-app.yml

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,33 @@ jobs:
3232
contains(github.event.comment.body, '/deploy-review-app'))
3333
runs-on: ubuntu-latest
3434
steps:
35+
- name: Setup Environment
36+
uses: ./.github/actions/setup-environment
37+
with:
38+
token: ${{ secrets.CPLN_TOKEN_STAGING }}
39+
org: ${{ vars.CPLN_ORG_STAGING }}
40+
41+
- name: Check if Review App Exists
42+
id: check-app
43+
env:
44+
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }}
45+
run: |
46+
# First check if cpflow exists
47+
if ! command -v cpflow &> /dev/null; then
48+
echo "Error: cpflow command not found"
49+
exit 1
50+
fi
51+
52+
# Check if app exists and save state
53+
if ! cpflow exists -a ${{ env.APP_NAME }}; then
54+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
55+
exit 0
56+
fi
57+
echo "APP_EXISTS=false" >> $GITHUB_ENV
58+
else
59+
echo "APP_EXISTS=true" >> $GITHUB_ENV
60+
fi
61+
3562
- name: Initial Checkout
3663
uses: actions/checkout@v4
3764

@@ -93,30 +120,6 @@ jobs:
93120
with:
94121
ref: ${{ env.PR_SHA }}
95122

96-
- name: Setup Environment
97-
uses: ./.github/actions/setup-environment
98-
with:
99-
token: ${{ secrets.CPLN_TOKEN_STAGING }}
100-
org: ${{ vars.CPLN_ORG_STAGING }}
101-
102-
- name: Check if Review App Exists
103-
id: check-app
104-
env:
105-
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }}
106-
run: |
107-
# First check if cpflow exists
108-
if ! command -v cpflow &> /dev/null; then
109-
echo "Error: cpflow command not found"
110-
exit 1
111-
fi
112-
113-
# Check if app exists and save state
114-
if ! cpflow exists -a ${{ env.APP_NAME }}; then
115-
echo "APP_EXISTS=false" >> $GITHUB_ENV
116-
else
117-
echo "APP_EXISTS=true" >> $GITHUB_ENV
118-
fi
119-
120123
- name: Validate Deployment Request
121124
id: validate
122125
run: |

0 commit comments

Comments
 (0)