Skip to content

fix: upgrade HeroDevs support links to HTTPS for security #386

fix: upgrade HeroDevs support links to HTTPS for security

fix: upgrade HeroDevs support links to HTTPS for security #386

Workflow file for this run

name: Playwright Tests
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
playwright:
if: github.actor != 'dependabot[bot]'
name: Playwright Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Wait for Netlify preview
id: wait-for-preview
run: |
# Calculate the Netlify preview URL based on the PR number
PREVIEW_URL="https://deploy-preview-${{ github.event.pull_request.number }}--expressjscom-preview.netlify.app"
echo "PREVIEW_URL=$PREVIEW_URL" >> "$GITHUB_ENV"
MAX_RETRIES=10
DELAY=20
echo "Checking Netlify preview: $PREVIEW_URL"
for i in $(seq 1 $MAX_RETRIES); do
# Check if the URL returns a 200 OK
if curl -s -I "$PREVIEW_URL" | grep -q "HTTP/.* 200"; then
echo "✅ Preview is live at $PREVIEW_URL"
exit 0
fi
echo "⏳ Waiting for Netlify to deploy... ($i/$MAX_RETRIES)"
sleep $DELAY
done
echo "❌ Preview not live after $((MAX_RETRIES*DELAY)) seconds."
exit 1
- name: Install dependencies
run: npm ci
- name: Get Playwright version
id: playwright-version
run: echo "version=$(npx playwright --version | awk '{print $2}')" >> $GITHUB_OUTPUT
- name: Cache Playwright browsers
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
restore-keys: |
playwright-${{ runner.os }}-
- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm run test:e2e
env:
PLAYWRIGHT_BASE_URL: ${{ env.PREVIEW_URL }}
- name: Upload Playwright test results
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-report
path: playwright-report/
retention-days: 30