|
72 | 72 | echo "Control Plane review app automation is not configured yet." |
73 | 73 | echo |
74 | 74 | echo "Missing required GitHub configuration:" |
75 | | - printf -- '- `%s`\n' "${missing[@]}" |
| 75 | + printf -- '- %s\n' "${missing[@]}" |
76 | 76 | echo |
77 | 77 | echo "Pushes to this pull request will skip review app deploys until the repository is configured." |
78 | 78 | } >> "$GITHUB_STEP_SUMMARY" |
@@ -119,9 +119,11 @@ jobs: |
119 | 119 | same_repo="true" |
120 | 120 | fi |
121 | 121 |
|
122 | | - echo "PR_NUMBER=$pr_number" >> "$GITHUB_ENV" |
123 | | - echo "APP_NAME=${{ vars.REVIEW_APP_PREFIX }}-$pr_number" >> "$GITHUB_ENV" |
124 | | - echo "PR_SHA=$pr_sha" >> "$GITHUB_ENV" |
| 122 | + { |
| 123 | + echo "PR_NUMBER=$pr_number" |
| 124 | + echo "APP_NAME=${{ vars.REVIEW_APP_PREFIX }}-$pr_number" |
| 125 | + echo "PR_SHA=$pr_sha" |
| 126 | + } >> "$GITHUB_ENV" |
125 | 127 | echo "same_repo=${same_repo}" >> "$GITHUB_OUTPUT" |
126 | 128 |
|
127 | 129 | - name: Validate review app deployment source |
@@ -182,9 +184,26 @@ jobs: |
182 | 184 | run: | |
183 | 185 | set -euo pipefail |
184 | 186 |
|
185 | | - if cpflow exists -a "${APP_NAME}" --org "${CPLN_ORG}"; then |
| 187 | + exists_output="" |
| 188 | + if exists_output="$(cpflow exists -a "${APP_NAME}" --org "${CPLN_ORG}" 2>&1)"; then |
| 189 | + if [[ -n "${exists_output}" ]]; then |
| 190 | + printf '%s\n' "${exists_output}" |
| 191 | + fi |
| 192 | +
|
186 | 193 | echo "exists=true" >> "$GITHUB_OUTPUT" |
187 | 194 | else |
| 195 | + case "${exists_output}" in |
| 196 | + *"Double check your org"*|*"Unknown API token format"*|*"ERROR"*|*"Error:"*|*"Traceback"*|*"Net::"*) |
| 197 | + echo "Failed to determine whether review app exists: ${APP_NAME}" >&2 |
| 198 | + printf '%s\n' "${exists_output}" >&2 |
| 199 | + exit 1 |
| 200 | + ;; |
| 201 | + esac |
| 202 | +
|
| 203 | + if [[ -n "${exists_output}" ]]; then |
| 204 | + printf '%s\n' "${exists_output}" |
| 205 | + fi |
| 206 | +
|
188 | 207 | echo "exists=false" >> "$GITHUB_OUTPUT" |
189 | 208 | fi |
190 | 209 |
|
|
0 commit comments