Skip to content

Commit 380a40a

Browse files
committed
try double checkout
1 parent 7b1e0a5 commit 380a40a

File tree

1 file changed

+4
-28
lines changed

1 file changed

+4
-28
lines changed

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

+4-28
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ env:
2323
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }}
2424
CPLN_ORG: ${{ vars.CPLN_ORG_STAGING }}
2525
PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
26-
PR_SHA: ${{ github.sha }}
2726

2827
jobs:
2928
debug:
@@ -41,30 +40,8 @@ jobs:
4140
contains(github.event.comment.body, '/deploy-review-app'))
4241
runs-on: ubuntu-latest
4342
steps:
44-
45-
- name: Validate Required Secrets and Variables
46-
shell: bash
47-
run: |
48-
missing=()
49-
50-
# Check required secrets
51-
if [ -z "$CPLN_TOKEN" ]; then
52-
missing+=("Secret: CPLN_TOKEN_STAGING")
53-
fi
54-
55-
# Check required variables
56-
if [ -z "$CPLN_ORG" ]; then
57-
missing+=("Variable: CPLN_ORG_STAGING")
58-
fi
59-
60-
if [ -z "$PREFIX" ]; then
61-
missing+=("Variable: REVIEW_APP_PREFIX")
62-
fi
63-
64-
if [ ${#missing[@]} -ne 0 ]; then
65-
echo "Required secrets/variables are not set: ${missing[*]}"
66-
exit 1
67-
fi
43+
- name: Initial Checkout
44+
uses: actions/checkout@v4
6845

6946
- name: Get PR HEAD Ref
7047
id: getRef
@@ -130,11 +107,10 @@ jobs:
130107
echo "APP_NAME=${{ vars.REVIEW_APP_PREFIX }}-$PR_NUMBER" >> $GITHUB_ENV
131108
echo "PR_REF=$(echo $PR_DATA | jq -r .headRefName)" >> $GITHUB_OUTPUT
132109
echo "PR_SHA=$(echo $PR_DATA | jq -r .headRefOid)" >> $GITHUB_ENV
133-
134-
- name: Checkout code
110+
111+
- name: Checkout the correct ref
135112
uses: actions/checkout@v4
136113
with:
137-
fetch-depth: 0
138114
ref: ${{ env.PR_SHA }}
139115

140116
- name: Setup Environment

0 commit comments

Comments
 (0)