Skip to content

playwright: get latest Netlify branch deploy, rm awaiting new build#16377

Merged
pettinarip merged 3 commits into
devfrom
get-netlify-branch-deploy
Sep 30, 2025
Merged

playwright: get latest Netlify branch deploy, rm awaiting new build#16377
pettinarip merged 3 commits into
devfrom
get-netlify-branch-deploy

Conversation

@wackerow
Copy link
Copy Markdown
Member

Description

  • Adds script to fetch latest Netlify branch deploy
  • Removes awaiting of a new branch deployment

Related Issue

Even with manual dispatch of playwright e2e test workflow (#16372), workflow is triggering a new build:
https://github.com/ethereum/ethereum-org-website/actions/runs/18041407774/job/51341063177

cc: @pettinarip

@netlify
Copy link
Copy Markdown

netlify Bot commented Sep 27, 2025

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit b735aec
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/68dabdbd1a98e300085ccffc
😎 Deploy Preview https://deploy-preview-16377--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 48 (🔴 down 7 from production)
Accessibility: 94 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 92 (no change from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the tooling 🔧 Changes related to tooling of the project label Sep 27, 2025
@wackerow wackerow requested a review from Copilot September 27, 2025 16:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Playwright workflow to fetch the latest Netlify branch deploy instead of waiting for a new build to complete. The changes prevent triggering unnecessary new builds during manual workflow dispatches.

  • Replaces the wait-for-netlify-action with a custom TypeScript script that retrieves the latest published deploy for the current branch
  • Removes the awaiting mechanism that was causing new builds to be triggered during manual workflow runs
  • Adds branch filtering to only run on dev, staging, and master branches

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/scripts/get-netlify-branch-deploy.ts New script that fetches the latest published Netlify deploy for the current branch via API
.github/workflows/playwright.yml Updated workflow step to use the new script instead of waiting for new deployments

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

if (!latest) {
console.error("No published deploy found for branch:", branch)
process.exit(1)
}
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback logic may result in an undefined URL. If both deploy_ssl_url and deploy_url are undefined, the output will be url=undefined. Consider adding validation to ensure at least one URL exists before proceeding.

Suggested change
}
}
// Ensure at least one URL exists
if (!latest.deploy_ssl_url && !latest.deploy_url) {
console.error("No deploy URL found for the latest published deploy.")
process.exit(1)
}

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/playwright.yml Outdated
if: |
github.ref_name == 'dev' || github.ref_name == 'staging' || github.ref_name == 'master'
run: |
npm install node-fetch@2
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing dependencies in workflow steps is not a best practice as it adds overhead and potential failure points. Consider adding node-fetch to the project's package.json dependencies or using Node.js built-in fetch (available in Node 18+).

Suggested change
npm install node-fetch@2

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

@pettinarip pettinarip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! forgot about this part, thanks

// Use GitHub Actions recommended output syntax (GITHUB_OUTPUT)
const output = `url=${latest.deploy_ssl_url || latest.deploy_url}`
if (process.env.GITHUB_OUTPUT) {
fs.appendFileSync(process.env.GITHUB_OUTPUT, output + "\n")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, interesting

@pettinarip pettinarip merged commit d1ab395 into dev Sep 30, 2025
8 checks passed
@pettinarip pettinarip deleted the get-netlify-branch-deploy branch September 30, 2025 15:25
This was referenced Oct 9, 2025
This was referenced Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling 🔧 Changes related to tooling of the project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants