Skip to content

Commit 92382fa

Browse files
committed
make sure to checkout right ref before setup
1 parent 893619a commit 92382fa

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

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

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,33 +32,6 @@ 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-
6235
- name: Initial Checkout
6336
uses: actions/checkout@v4
6437

@@ -120,6 +93,33 @@ jobs:
12093
with:
12194
ref: ${{ env.PR_SHA }}
12295

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+
123123
- name: Validate Deployment Request
124124
id: validate
125125
run: |

0 commit comments

Comments
 (0)