Skip to content

Commit d66c312

Browse files
committed
fix: pass Cypress preview URL within e2e job
Use an E2E-job step output for the Cloudflare Pages branch alias and feed that into the Cypress action config. This avoids the deploy job output being dropped as secret-like while still passing Cypress a concrete baseUrl.
1 parent cb64fde commit d66c312

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,21 +99,25 @@ jobs:
9999
- name: Build ReScript
100100
run: yarn build:res
101101
- name: Set Cypress base URL
102+
id: cypress-base-url
102103
shell: bash
103104
run: |
104105
RAW_BRANCH="${{ github.head_ref || github.ref_name }}"
105106
106107
if [[ "$RAW_BRANCH" == "master" ]]; then
107-
echo "CYPRESS_BASE_URL=https://rescript-lang.org" >> "$GITHUB_ENV"
108+
CYPRESS_BASE_URL="https://rescript-lang.org"
108109
else
109110
SAFE_BRANCH="${RAW_BRANCH//\//-}"
110111
111112
SAFE_BRANCH=$(echo "$SAFE_BRANCH" | tr '[:upper:]' '[:lower:]')
112113
113-
echo "CYPRESS_BASE_URL=https://${SAFE_BRANCH}.rescript-lang.pages.dev" >> "$GITHUB_ENV"
114+
CYPRESS_BASE_URL="https://${SAFE_BRANCH}.rescript-lang.pages.dev"
114115
fi
116+
117+
echo "url=$CYPRESS_BASE_URL" >> "$GITHUB_OUTPUT"
115118
- name: Cypress E2E tests
116119
uses: cypress-io/github-action@v7
117120
with:
118121
install: false
119-
command: yarn cypress run --browser chrome --config baseUrl="$CYPRESS_BASE_URL"
122+
browser: chrome
123+
config: baseUrl=${{ steps.cypress-base-url.outputs.url }}

0 commit comments

Comments
 (0)