Skip to content

Conversation

@cryptodev-2s
Copy link
Contributor

@cryptodev-2s cryptodev-2s commented Nov 18, 2025

With these changes, you can post a comment in a PR with the content @metamaskbot publish-preview, and it will build the branch and publish it under the @metamask-previews under a special version. This works very similarly to how it works in core.


Note

Introduce a preview-build workflow triggered by PR comments, with scripts to scope/version packages for previews and README docs on using them.

  • CI / GitHub Actions:
    • Add /.github/workflows/publish-preview.yml to publish preview builds on @metamaskbot publish-preview issue comments.
    • Includes fork detection, reacts with 👍, checks out PR, prepares preview, builds, publishes to npm with --tag preview, and comments back with build info.
  • Scripts:
    • Add scripts/prepare-preview-builds.sh and scripts/prepare-preview-builds.jq to rewrite package.json for previews (scope to @metamask-previews, append -preview-<short_sha> to version) and reinstall deps.
    • Add scripts/generate-preview-build-message.sh to output install identifier for the preview build.
  • Docs:
    • Update README.md with instructions for creating, using, and updating preview builds (including Yarn/NPM override examples).

Written by Cursor Bugbot for commit 804f197. This will update automatically on new commits. Configure here.

@cryptodev-2s cryptodev-2s requested a review from mcmire November 18, 2025 15:18
@cryptodev-2s cryptodev-2s self-assigned this Nov 18, 2025
@cryptodev-2s cryptodev-2s marked this pull request as ready for review November 18, 2025 15:18
@cryptodev-2s cryptodev-2s requested a review from a team as a code owner November 18, 2025 15:18
@cryptodev-2s cryptodev-2s enabled auto-merge (squash) November 18, 2025 15:27
@cryptodev-2s cryptodev-2s requested a review from a team as a code owner November 18, 2025 15:48
@cryptodev-2s cryptodev-2s requested review from Mrtenz and removed request for a team November 18, 2025 15:50
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v1
with:
is-high-risk-environment: true
Copy link

Choose a reason for hiding this comment

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

Bug: Incorrect branch checkout defeats preview builds.

The MetaMask/action-checkout-and-setup@v1 action likely performs a repository checkout that overwrites the PR branch checked out in the previous step (line 60). This would cause the workflow to build and publish from the default branch instead of the PR branch, defeating the purpose of preview builds. The action should either be removed or configured to skip the checkout step if that's supported.

Fix in Cursor Fix in Web

@cryptodev-2s cryptodev-2s merged commit 7d5f2c8 into main Nov 18, 2025
14 checks passed
@cryptodev-2s cryptodev-2s deleted the add-preview-builds branch November 18, 2025 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants