Skip to content
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

chore: add pkg.pr.new workflow #5273

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish Playground Preview, Please!
on:
pull_request:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we're not going to use the preview for every PR, should we create one for every PR? Or should we use label/comment as a trigger?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would just run on every PR, it won't run without approval anyway, but it can be narrowed down.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

types: [opened, synchronize, reopened]

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.18.1'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Publish preview
run: yarn exec pkg-pr-new -- publish './packages/@lwc/*' './packages/lwc' --template './playground'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the token require any particular perms?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems pretty basic to me. I think it even runs without the token, it just won't provide the comment, and won't update when new commits are pushed.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"lint-staged": "^15.4.3",
"magic-string": "^0.30.17",
"nx": "20.4.4",
"pkg-pr-new": "^0.0.40",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to add this if we're using yarn exec instead of dlx:

yarn exec v1.22.22
error Couldn't find the binary pkg-pr-new

"prettier": "^3.5.1",
"rollup": "^4.34.8",
"terser": "^5.39.0",
Expand Down
Loading