-
Notifications
You must be signed in to change notification settings - Fork 14
ci: skip live e2e tests on fork PRs #654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,10 +55,26 @@ jobs: | |
| run: npx playwright install --with-deps chromium | ||
| - name: Build | ||
| run: npm run build --workspaces=true | ||
| # Fork PRs don't have access to secrets, so live E2E tests (e.g. Netlify | ||
| # deploy tests) must be skipped. | ||
| - name: Flag fork PR | ||
| if: | ||
| ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != | ||
| 'netlify/primitives' }} | ||
| run: echo "SKIP_LIVE_TESTS=true" >> "$GITHUB_ENV" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This step executes in the Useful? React with 👍 / 👎.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GHA defaults to bash even on Windows runners! |
||
| - name: Tests | ||
| run: npm run test --workspaces=true | ||
| env: | ||
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | ||
| - name: Warn if live tests were skipped | ||
| if: ${{ env.SKIP_LIVE_TESTS == 'true' }} | ||
| run: | | ||
| echo "::warning::Live E2E tests were skipped because secrets are not available (likely a fork PR)." | ||
| echo "## ⚠️ Live E2E tests were skipped" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "" >> "$GITHUB_STEP_SUMMARY" | ||
| echo "This workflow run does not have access to secrets (likely a fork PR)." >> "$GITHUB_STEP_SUMMARY" | ||
| echo "Live tests that deploy to Netlify were skipped." >> "$GITHUB_STEP_SUMMARY" | ||
| echo "Maintainers: before merging, verify that these tests pass or aren't relevant." >> "$GITHUB_STEP_SUMMARY" | ||
| test-node18: | ||
| name: Test Node.js 18 for specific packages | ||
| runs-on: ${{ matrix.os }} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.