|
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 |
| -
|
62 | 35 | - name: Initial Checkout
|
63 | 36 | uses: actions/checkout@v4
|
64 | 37 |
|
@@ -120,6 +93,33 @@ jobs:
|
120 | 93 | with:
|
121 | 94 | ref: ${{ env.PR_SHA }}
|
122 | 95 |
|
| 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 | + if [[ "${{ github.event_name }}" == "pull_request" ]]; then |
| 116 | + exit 0 |
| 117 | + fi |
| 118 | + echo "APP_EXISTS=false" >> $GITHUB_ENV |
| 119 | + else |
| 120 | + echo "APP_EXISTS=true" >> $GITHUB_ENV |
| 121 | + fi |
| 122 | +
|
123 | 123 | - name: Validate Deployment Request
|
124 | 124 | id: validate
|
125 | 125 | run: |
|
|
0 commit comments