|
23 | 23 | CPLN_TOKEN: ${{ secrets.CPLN_TOKEN_STAGING }}
|
24 | 24 | CPLN_ORG: ${{ vars.CPLN_ORG_STAGING }}
|
25 | 25 | PR_NUMBER: ${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }}
|
26 | | - PR_SHA: ${{ github.sha }} |
27 | 26 |
|
28 | 27 | jobs:
|
29 | 28 | debug:
|
|
41 | 40 | contains(github.event.comment.body, '/deploy-review-app'))
|
42 | 41 | runs-on: ubuntu-latest
|
43 | 42 | 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 |
68 | 45 |
|
69 | 46 | - name: Get PR HEAD Ref
|
70 | 47 | id: getRef
|
@@ -130,11 +107,10 @@ jobs:
|
130 | 107 | echo "APP_NAME=${{ vars.REVIEW_APP_PREFIX }}-$PR_NUMBER" >> $GITHUB_ENV
|
131 | 108 | echo "PR_REF=$(echo $PR_DATA | jq -r .headRefName)" >> $GITHUB_OUTPUT
|
132 | 109 | echo "PR_SHA=$(echo $PR_DATA | jq -r .headRefOid)" >> $GITHUB_ENV
|
133 | | - |
134 | | - - name: Checkout code |
| 110 | + |
| 111 | + - name: Checkout the correct ref |
135 | 112 | uses: actions/checkout@v4
|
136 | 113 | with:
|
137 | | - fetch-depth: 0 |
138 | 114 | ref: ${{ env.PR_SHA }}
|
139 | 115 |
|
140 | 116 | - name: Setup Environment
|
|
0 commit comments