|
32 | 32 | contains(github.event.comment.body, '/deploy-review-app'))
|
33 | 33 | runs-on: ubuntu-latest
|
34 | 34 | 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 | +
|
35 | 62 | - name: Initial Checkout
|
36 | 63 | uses: actions/checkout@v4
|
37 | 64 |
|
@@ -93,30 +120,6 @@ jobs:
|
93 | 120 | with:
|
94 | 121 | ref: ${{ env.PR_SHA }}
|
95 | 122 |
|
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 |
| -
|
120 | 123 | - name: Validate Deployment Request
|
121 | 124 | id: validate
|
122 | 125 | run: |
|
|
0 commit comments