name: Preview Release on: pull_request: permissions: contents: read pull-requests: write concurrency: ${{ github.workflow }}-${{ github.ref }} jobs: preview-release: # Build secrets: same-repo PRs only; fork PRs evaluate to empty (explicit for review). timeout-minutes: 45 runs-on: depot-ubuntu-22.04-8 permissions: contents: write pull-requests: write container: image: node:24@sha256:9d266751ca3d7fdbe651c878ffd5ad0a42fed49a18c283509267c97f025b7496 steps: - name: Checkout Repo uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 with: fetch-depth: 2 - run: git config --global --add safe.directory $GITHUB_WORKSPACE - name: pnpm setup uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 - name: Install packages run: pnpm install --frozen-lockfile --prefer-offline - name: Find changed packages id: changed_packages uses: tj-actions/changed-files@3c4bc6fa0ca4718d438e0a4bd3ea81fbb0e6e2be with: files: packages/** dir_names: true dir_names_max_depth: 2 - name: Run Build if: steps.changed_packages.outputs.all_changed_and_modified_files != '' run: pnpm build env: SPAM_ASSASSIN_HOST: ${{ github.event.pull_request.head.repo.full_name == github.repository && secrets.SPAM_ASSASSIN_HOST || '' }} SPAM_ASSASSIN_PORT: ${{ github.event.pull_request.head.repo.full_name == github.repository && secrets.SPAM_ASSASSIN_PORT || '' }} TURBO_TOKEN: ${{ github.event.pull_request.head.repo.full_name == github.repository && secrets.TURBO_TOKEN || '' }} TURBO_TEAM: ${{ github.event.pull_request.head.repo.full_name == github.repository && secrets.TURBO_TEAM || '' }} REDIS_URL: redis://localhost:6379 - name: Publish changed packages to pkg.pr.new if: steps.changed_packages.outputs.all_changed_and_modified_files != '' && github.event.pull_request.head.repo.full_name == github.repository env: CHANGED_PACKAGES: ${{ steps.changed_packages.outputs.all_changed_and_modified_files }} run: pnpm pkg-pr-new publish $CHANGED_PACKAGES --pnpm