Skip to content

Commit

Permalink
chore: pkg.pr.new preview with label and comment (#18211)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aslemammad authored Oct 28, 2024
1 parent b9b925e commit 24befe8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 71 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/preview-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Preview release

env:
# install playwright binary manually (because pnpm only runs install script once)
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"

permissions:
pull-requests: write

on:
push:
branches:
- main
pull_request:
types: [labeled]

jobs:
preview:
if: >
github.repository == 'vitejs/vite' &&
(github.event_name == 'push' ||
(github.event.issue.pull_request && contains(github.event.pull_request.labels.*.name, 'trigger: preview')))
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/[email protected]

- name: Install dependencies
run: pnpm install

- name: Build
working-directory: ./packages/vite
run: pnpm build

- run: pnpm dlx [email protected] publish --compact --pnpm ./packages/vite

- if: github.event_name != 'push'
run: |
gh issue edit ${{ github.event.issue.number }} --remove-label "trigger: preview" --repo ${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71 changes: 0 additions & 71 deletions .github/workflows/publish-commit.yml

This file was deleted.

0 comments on commit 24befe8

Please sign in to comment.